-
-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (38 loc) · 1.07 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: release
on:
push:
tags:
- '*'
env:
DOCKER_IMAGE: chuhlomin/render-template
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- 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@v3
- name: Update v1 tag
shell: bash
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git tag -f v1
git push -f origin v1