From a53094ec925c4fffd8c73e86e570bade7c48bd1c Mon Sep 17 00:00:00 2001 From: Saba Date: Thu, 15 Sep 2022 20:28:41 +0300 Subject: [PATCH] Add workflow dispatch support in build.yml - To support dispatch, set the image label based on the branch name - Master build should still be tagged with latest to get benefit of the standard production Docker label --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ad56e8ac..5b67d2f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,10 @@ on: - Dockerfile - docker-compose.yml - .github/workflows/build.yml + workflow_dispatch: + +env: + DOCKER_IMAGE_TAG: ${{ github.ref == 'refs/heads/master' && 'latest' || github.ref_name }} jobs: build: @@ -36,6 +40,6 @@ jobs: context: . file: Dockerfile push: true - tags: ghcr.io/${{ github.repository }}:latest + tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} build-args: | PORT=8000 \ No newline at end of file