44 release :
55 types : [published]
66
7- permissions :
8- id-token : write
9- attestations : write
10-
117jobs :
12- build :
8+ version :
139 runs-on : ubuntu-latest
14-
10+ outputs :
11+ version : ${{ steps.version.outputs.version }}
1512 steps :
16- - name : Checkout
17- uses : actions/checkout@v7
18-
19- - name : Extract version (without v)
20- id : version
13+ - id : version
2114 run : |
22- if [ "${{ github.event_name }}" = "release" ]; then
23- # Extract version from release tag (remove any 'v' prefix)
24- VERSION="${{ github.event.release.tag_name }}"
25- VERSION=${VERSION#v} # Remove 'v' prefix if present
26- else
27- VERSION="${{ github.event.inputs.version }}"
28- VERSION=${VERSION#v} # Remove 'v' prefix if present
29- fi
30-
31- echo "version=$VERSION" >> $GITHUB_OUTPUT
32- echo "Syncing version: $VERSION"
33-
34- - name : Set up Docker Buildx
35- uses : docker/setup-buildx-action@v4
36-
37- - name : Log in to Docker Hub
38- uses : docker/login-action@v4
39- with :
40- username : tragiccode
41- password : ${{ secrets.DOCKERHUB_TOKEN }}
42-
43- # Revisit this. We should probably be triggering this off of a tag event.
44- # Which would automatically tag the image with the version and latest and allow us to remove
45- # the manual 'tags' property below
46- - name : Extract metadata (tags, labels) for Docker
47- id : meta
48- uses : docker/metadata-action@v6
49- with :
50- images : tragiccode/busly-cli
51- tags : |
52- ${{ steps.version.outputs.version }}
53- latest
54-
55- - name : Build and push Docker image
56- id : push
57- uses : docker/build-push-action@v7
58- with :
59- context : .
60- file : ./src/BuslyCLI.Console/Dockerfile
61- build-args : |
62- APP_VERSION=${{ steps.version.outputs.version }}
63- push : true
64- tags : ${{ steps.meta.outputs.tags }}
65- labels : ${{ steps.meta.outputs.labels }}
66-
67- - name : Generate artifact attestation
68- uses : actions/attest-build-provenance@v4
69- with :
70- subject-name : index.docker.io/tragiccode/busly-cli
71- subject-digest : ${{ steps.push.outputs.digest }}
72- push-to-registry : true
15+ VERSION="${{ github.event.release.tag_name }}"
16+ VERSION=${VERSION#v}
17+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
18+
19+ docker :
20+ needs : version
21+ uses : ./.github/workflows/docker_build_or_deploy.yml
22+ # permissions:
23+ # contents: read
24+ # id-token: write
25+ # attestations: write
26+ with :
27+ push : true
28+ version : ${{ needs.version.outputs.version }}
29+ secrets :
30+ DOCKERHUB_TOKEN : ${{ secrets.DOCKERHUB_TOKEN }}
0 commit comments