diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..406ae62 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Release + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: 'Get the version' + id: get_version + run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_OUTPUT" + + - name: 'Login to ACR' + uses: docker/login-action@v3 + with: + registry: ${{ vars.REGISTRY_LOGIN_SERVER }} + username: ${{ vars.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - name: Docker meta + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ vars.REGISTRY_LOGIN_SERVER }}/ffc-operations + tags: | + type=semver,pattern={{major}}.{{minor}}.{{patch}},value=${{ steps.get_version.outputs.VERSION }} + type=semver,pattern={{major}}.{{minor}},value=${{ steps.get_version.outputs.VERSION }} + type=semver,pattern={{major}},value=${{ steps.get_version.outputs.VERSION }} + flavor: | + latest=false + - name: Build and push docker image + id: docker_build + uses: docker/build-push-action@v3 + with: + file: prod.Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + - name: Docker image digest + run: echo ${{ steps.docker_build.outputs.digest }}