release #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v1.*' | |
env: | |
DOCKER_IMAGE: chuhlomin/render-template | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get the tag | |
id: get_tag | |
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
- name: Build and push Docker image | |
uses: chuhlomin/actions/docker-build-push@main | |
with: | |
username: chuhlomin | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
image_name: ${{ env.DOCKER_IMAGE }} | |
tags: ${{ env.DOCKER_IMAGE }}:${{ steps.get_tag.outputs.tag }} | |
update-tag: | |
runs-on: ubuntu-latest | |
environment: v1 # requires approval | |
needs: release | |
if: startsWith(github.ref, 'refs/tags/v1.') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update v1 tag | |
shell: bash | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "gha@chuhlomin.com" | |
git tag -f v1 | |
git push -f origin v1 |