From 7cd9bafd67a437702bb58c52348f9192b38ff9bc Mon Sep 17 00:00:00 2001 From: Kirill Sibirev Date: Tue, 11 Jun 2024 11:36:24 +0200 Subject: [PATCH] App release --- .github/workflows/release_app.yml | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/release_app.yml diff --git a/.github/workflows/release_app.yml b/.github/workflows/release_app.yml new file mode 100644 index 0000000..0e6270e --- /dev/null +++ b/.github/workflows/release_app.yml @@ -0,0 +1,49 @@ +name: Release app + +on: + workflow_dispatch: + push: + tags: + - 'release/[0-9]+\.[0-9]+\.[0-9]+' + + +# Defines two custom environment variables for the workflow. +# These are used for the Container registry domain, and a name for the Docker image that this workflow builds. +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + + # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Uses the `docker/login-action` action to log in to the Container registry + # using the account and password that will publish the packages. + # Once published, the packages are scoped to the account defined here. + - name: Log in to the Container registry + uses: docker/login-action@v3.1.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Parse tag + id: tag + run: | + echo "version=$(echo ${GITHUB_REF_NAME#release/*})" >> $GITHUB_OUTPUT + + - name: Build and push Docker image + uses: docker/build-push-action@v5.3.0 + with: + context: . + push: true + tags: ${{ steps.tag.outputs.version }}