From 0222d42e281e1578b5f339cbaabbfd0a82c60c6b Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 17 Aug 2020 10:52:44 +0100 Subject: [PATCH 1/2] :bug: Fix docker build syntax --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 01081fe..60cc42b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -32,7 +32,7 @@ jobs: - name: Build image for Docker Hub env: VERSION: ${{ needs.release-on-push.output.ver }} - run: docker build . --file Dockerfile --tag luketainton/fhed:$VERSION luketainton/fhed:latest + run: docker build . --file Dockerfile --tag luketainton/fhed:$VERSION --tag luketainton/fhed:latest - name: Push image to Docker Hub env: VERSION: ${{ needs.release-on-push.output.ver }} @@ -51,7 +51,7 @@ jobs: - name: Build image for GitHub Package Registry env: VERSION: ${{ needs.release-on-push.output.ver }} - run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/fhed/fhed:latest docker.pkg.github.com/luketainton/fhed/fhed:$VERSION + run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/fhed/fhed:latest --tag docker.pkg.github.com/luketainton/fhed/fhed:$VERSION - name: Push image to GitHub Package Registry env: VERSION: ${{ needs.release-on-push.output.ver }} -- 2.49.1 From c5769111b2326a73d12726f3bf51bf23c8025f56 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Mon, 17 Aug 2020 11:04:40 +0100 Subject: [PATCH 2/2] Add tag as output --- .github/workflows/deploy.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 60cc42b..92a67fd 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -8,6 +8,7 @@ jobs: runs-on: ubuntu-latest outputs: ver: ${{ steps.release.outputs.version }} + tag: ${{ steps.release.outputs.tag_name }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: @@ -32,12 +33,14 @@ jobs: - name: Build image for Docker Hub env: VERSION: ${{ needs.release-on-push.output.ver }} - run: docker build . --file Dockerfile --tag luketainton/fhed:$VERSION --tag luketainton/fhed:latest + TAG: ${{ needs.release-on-push.output.tag }} + run: docker build . --file Dockerfile --build-arg VERSION --tag luketainton/fhed:$TAG --tag luketainton/fhed:latest - name: Push image to Docker Hub env: VERSION: ${{ needs.release-on-push.output.ver }} + TAG: ${{ needs.release-on-push.output.tag }} run: | - docker push luketainton/fhed:$VERSION && + docker push luketainton/fhed:$TAG && docker push luketainton/fhed:latest docker-ghr: @@ -51,12 +54,14 @@ jobs: - name: Build image for GitHub Package Registry env: VERSION: ${{ needs.release-on-push.output.ver }} - run: docker build . --file Dockerfile --tag docker.pkg.github.com/luketainton/fhed/fhed:latest --tag docker.pkg.github.com/luketainton/fhed/fhed:$VERSION + TAG: ${{ needs.release-on-push.output.tag }} + run: docker build . --file Dockerfile --build-arg VERSION --tag docker.pkg.github.com/luketainton/fhed/fhed:latest --tag docker.pkg.github.com/luketainton/fhed/fhed:$TAG - name: Push image to GitHub Package Registry env: VERSION: ${{ needs.release-on-push.output.ver }} + TAG: ${{ needs.release-on-push.output.tag }} run: | - docker push docker.pkg.github.com/luketainton/fhed/fhed:$VERSION && + docker push docker.pkg.github.com/luketainton/fhed/fhed:$TAG && docker push docker.pkg.github.com/luketainton/fhed/fhed:latest deploy: -- 2.49.1