From 755b5e4da31427ba90ccc7243bbc8c841b474a58 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Thu, 18 Apr 2024 16:21:22 +0300 Subject: [PATCH] WIP --- .../workflows/publish-ubuntu-22.04-images.yaml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-ubuntu-22.04-images.yaml b/.github/workflows/publish-ubuntu-22.04-images.yaml index 9dc9e583d240..b420820c853b 100644 --- a/.github/workflows/publish-ubuntu-22.04-images.yaml +++ b/.github/workflows/publish-ubuntu-22.04-images.yaml @@ -1,14 +1,17 @@ name: Build and publish ubuntu-22.04-userver images 'on': + #schedule: + # - cron: '30 5 * * 6' # Every Saturday at 5:30 + workflow_dispatch: + release: + types: [published] pull_request: push: branches: - master - develop - feature/** - #schedule: - # - cron: '30 5 * * 6' # Every Saturday at 5:30 jobs: build_and_publish: @@ -17,6 +20,8 @@ jobs: permissions: contents: read packages: write + env: + USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }} steps: - uses: actions/checkout@v2 - name: Login to GitHub Container Registry @@ -27,9 +32,9 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} #- name: Build the ubuntu-22.04-userver Docker image # run: | - # docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver:latest -f scripts/docker/ubuntu-22.04.dockerfile . - # docker push ghcr.io/userver-framework/ubuntu-22.04-userver:latest + # docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04.dockerfile . + # docker push ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG} - name: Build the ubuntu-22.04-userver-pg Docker image run: | - docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-pg:latest -f scripts/docker/ubuntu-22.04-pg.dockerfile . - docker push ghcr.io/userver-framework/ubuntu-22.04-userver-pg:latest + docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04-pg.dockerfile . + docker push ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG}