File tree Expand file tree Collapse file tree 4 files changed +20
-12
lines changed
Expand file tree Collapse file tree 4 files changed +20
-12
lines changed Original file line number Diff line number Diff line change 1111 runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v4
14+
1415 - uses : cachix/install-nix-action@v27
1516 with :
1617 github_access_token : ${{ secrets.GITHUB_TOKEN }}
18+ - uses : DeterminateSystems/magic-nix-cache-action@main
19+
1720 - uses : nicknovitski/nix-develop@v1
1821 - run : just setup
1922 - run : just check
Original file line number Diff line number Diff line change 11name : " Publish to the GitHub Container registry"
22
3- env :
4- REGISTRY : ghcr.io
5-
63on :
74 workflow_dispatch :
85 push :
@@ -25,15 +22,16 @@ jobs:
2522 - uses : cachix/install-nix-action@v27
2623 with :
2724 github_access_token : ${{ secrets.GITHUB_TOKEN }}
25+ - uses : DeterminateSystems/magic-nix-cache-action@main
26+
2827 - uses : nicknovitski/nix-develop@v1
2928
30- - run : just build-docker-image ${{ github.ref_name }}
31-
3229 - name : Log in to the Container registry
33- uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
30+ uses : docker/login-action@v3
3431 with :
35- registry : ${{ env.REGISTRY }}
32+ registry : ghcr.io
3633 username : ${{ github.actor }}
3734 password : ${{ secrets.GITHUB_TOKEN }}
3835
39- - run : docker push ${{ env.REGISTRY }}/kutu-dev/documentation
36+ - run : just build-docker-image "${{ github.ref_name }}"
37+ - run : just publish-docker-image "${{ github.ref_name }}"
Original file line number Diff line number Diff line change @@ -106,6 +106,13 @@ new-project project_name:
106106# Build the Docker image of a project given a git tag. Mostly used in the CI/CD
107107[script ]
108108build-docker-image tag :
109- let project = (" documentation/0.0.1" | parse " {project}/{version}" | reject version ).0 .project
109+ let tag = ({{tag}} | parse " {project}/{version}" ).0
110110
111- just -f $" ./projects/($project)/justfile" build-docker-image
111+ just -f $" ./projects/($tag.project)/justfile" build-docker-image $tag.version
112+
113+ # Publish to ghcr.io the Docker image of a project given a git tag. Mostly used in the CI/CD
114+ [script ]
115+ publish-docker-image tag :
116+ let tag = ({{tag}} | parse " {project}/{version}" ).0
117+
118+ docker push $" ghcr.io/kutu-dev/($tag.project):($tag.version)"
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ serve: generate-indices
5151
5252# Build the Docker image of the documentation. Mostly used in the CI/CD
5353[script ]
54- build-docker-image :
54+ build-docker-image tag :
5555 cd ../ ..
5656
57- docker build -t ghcr.io/ kutu-dev/ documentation -f projects/ documentation/ Dockerfile .
57+ docker build -t ghcr.io/ kutu-dev/ documentation: {{ tag }} -f projects/ documentation/ Dockerfile .
You can’t perform that action at this time.
0 commit comments