From f1a33efd63e296c4f92b610c0300f1867310573c Mon Sep 17 00:00:00 2001 From: Christopher Bisset Date: Wed, 29 Jun 2022 08:41:47 +1000 Subject: [PATCH] created github workflow for dev image --- .github/workflows/publish-image.yaml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/publish-image.yaml diff --git a/.github/workflows/publish-image.yaml b/.github/workflows/publish-image.yaml new file mode 100644 index 0000000..d51a1dc --- /dev/null +++ b/.github/workflows/publish-image.yaml @@ -0,0 +1,43 @@ +name: Publish Image + +on: + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Variable Gathering + id: gathervars + run: | + # get a current BUILD_DATE + echo "::set-output name=BUILD_DATE::$(date +%Y%m%d-%H%M%S)" + # set version based on BUILD_DATE + echo "::set-output name=VERSION::$(date +%Y.%m.%d)-1" + + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker Image + uses: docker/build-push-action@v2 + with: + build-args: | + BUILD_DATE=${{ steps.gathervars.outputs.BUILD_DATE }} + VERSION=${{ steps.gathervars.outputs.VERSION }} + context: ./docker/development + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ steps.gathervars.outputs.VERSION }} + push: true