-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.29 KB
/
go-svc-template-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: go-svc-template - Release
on:
push:
branches:
- main
jobs:
build:
if: ${{ !contains(github.event.head_commit.message, 'norelease') }}
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- uses: actions/checkout@main
# This will create or bump an existing semver tag
- name: Create tag
uses: mathieudutour/github-tag-action@v6.1
id: create_tag
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
fetch_all_tags: true
# These variables are not used but are available for use if you want to
# create additional docker image tags.
- name: Set version vars
id: set-version-vars
run: |
echo "GITHUB_VERSION=${{ steps.create_tag.outputs.new_version }}" >> $GITHUB_ENV
echo "GITHUB_TAG=${{ steps.create_tag.outputs.new_tag }}" >> $GITHUB_ENV
echo "GITHUB_SHORT_SHA=`git rev-parse --short HEAD`" >> $GITHUB_ENV
- name: Run build & push
run: |
make docker/build