File tree Expand file tree Collapse file tree 3 files changed +35
-3
lines changed
Expand file tree Collapse file tree 3 files changed +35
-3
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ release :
3+ types : [published]
4+
5+ jobs :
6+ build-push-image :
7+ runs-on : ubuntu-latest
8+ steps :
9+ - name : Publish version env var
10+ run : echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
11+
12+ - name : checkout code
13+ uses : actions/checkout@v2
14+
15+ - name : Login to Docker Hub
16+ uses : docker/login-action@v1
17+ with :
18+ username : ${{ secrets.DOCKERHUB_USERNAME }}
19+ password : ${{ secrets.DOCKERHUB_TOKEN }}
20+
21+ - name : Set up Docker Buildx
22+ id : buildx
23+ uses : docker/setup-buildx-action@v1
24+
25+ - name : build and push the image
26+ run : |
27+ docker buildx build . \
28+ --build-arg BUILD_ID=${{ github.run_id }}
29+ --build-arg COMMIT_ID=$(git rev-parse --short "$GITHUB_SHA")
30+ --tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:${{ env.VERSION }} \
31+ --tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ secrets.DOCKERHUB_REPO }}:latest \
32+ --platform linux/amd64,linux/arm64
33+ --push
Original file line number Diff line number Diff line change @@ -4,12 +4,14 @@ ARG NAME_IMAGE_TAG='8.0-fpm-alpine3.13'
44FROM ${NAME_IMAGE_BASE}:${NAME_IMAGE_TAG}
55
66ARG BUILD_ID="unknown"
7+ ARG COMMIT_ID="unknown"
78ARG VERSION_OS='3.13'
89ARG VERSION_PHP='8.0'
910
1011LABEL \
1112 ALPINE="$VERSION_OS" \
1213 BUILD_ID="$BUILD_ID" \
14+ COMMIT_ID="$COMMIT_ID" \
1315 MAINTAINER=
'Samuel Fontebasso <[email protected] >' \
1416 PHP_VERSION="$VERSION_PHP"
1517
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments