From d623c52f828495cade3e8183bd9402eb10d87d1b Mon Sep 17 00:00:00 2001 From: Petro Kurbatskyi Date: Wed, 24 Mar 2021 14:02:45 +0100 Subject: [PATCH] EZP-32364: Use docker image, make automatic docker build --- .github/workflows/release.yml | 26 ++++++++++++++++++++++++++ action.yml | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a685e04 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,26 @@ +name: Publish Docker image +on: + release: + types: [published] +jobs: + push_to_registry: + name: Push Docker image to GitHub Packages + runs-on: ubuntu-latest + steps: + - name: Set Env + run: | + echo "BUILD_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + echo "BUILD_SHA=${GITHUB_SHA:0:7}" >> $GITHUB_ENV + - name: Docker Login + uses: docker/login-action@v1.8.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and Push to GitHub Packages + uses: docker/build-push-action@v2 + with: + tags: | + ghcr.io/${{ github.repository }}:${{ env.BUILD_TAG }} + ghcr.io/${{ github.repository }}:${{ env.BUILD_SHA }} + push: true diff --git a/action.yml b/action.yml index 0ab3935..c6621c5 100644 --- a/action.yml +++ b/action.yml @@ -10,4 +10,4 @@ outputs: description: "Output from the action" runs: using: "docker" - image: "Dockerfile" + image: "docker://ghcr.io/ibexa-yuna/version-logic-action:v1.0.0"