-
Notifications
You must be signed in to change notification settings - Fork 535
70 lines (60 loc) · 1.81 KB
/
prerelease.yaml
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: prerelease
on:
push:
tags:
- "v*.*.*-*"
env:
GO_VERSION: "1.18.10"
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
jobs:
prerelease:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: env.REGISTRY_USERNAME != ''
with:
version: latest
args: release --rm-dist --skip-publish --skip-sign
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/terraform-docs-v*
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
docker:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set version output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v'
- name: Login to Docker
uses: docker/login-action@v1
if: env.REGISTRY_USERNAME != ''
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: make docker push
env:
DOCKER_TAG: ${{ steps.vars.outputs.tag }}
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}