11name : Publish image to GHCR
22
33on :
4- release :
5- types : [created]
4+ release :
5+ types : [created]
66
77jobs :
8- build_and_publish :
9- runs-on : ubuntu-latest
10- steps :
11- - name : Get code access
12- uses : actions/checkout@v3
13-
14- - name : Set up Docker Buildx
15- uses : docker/setup-buildx-action@v2
16-
17- - name : Login to GHCR
18- run : echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u yashkathe --password-stdin
8+ build_and_publish :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Get code access
12+ uses : actions/checkout@v3
1913
20- - name : Extract version number
21- id : extract_version
22- run : echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
14+ - name : Set up Docker Buildx
15+ uses : docker/setup-buildx-action@v2
2316
24- - name : Build and push the image
25- run : |
26- docker build . --tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
27- docker push ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
28- docker tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }} ghcr.io/yashkathe/f1-api-node:latest
29- docker push ghcr.io/yashkathe/f1-api-node:latest
17+ - name : Login to GHCR
18+ run : echo "${{ secrets.GHCR_TOKEN }}" | docker login ghcr.io -u yashkathe --password-stdin
19+
20+ - name : Extract version number
21+ id : extract_version
22+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
23+
24+ - name : Build and push the image
25+ run : |
26+ docker build . --tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
27+ docker push ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }}
28+ docker tag ghcr.io/yashkathe/f1-api-node:${{ env.RELEASE_VERSION }} ghcr.io/yashkathe/f1-api-node:latest
29+ docker push ghcr.io/yashkathe/f1-api-node:latest
0 commit comments