-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (55 loc) · 1.33 KB
/
deploy.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy
on:
workflow_call:
inputs:
forRef:
required: true
type: string
workflow_dispatch:
inputs:
forRef:
description: 'Branch, SHA or Tag to release'
required: false
type: string
create:
permissions:
contents: write
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.forRef }}
- name: Unshallow
run: git fetch --prune --unshallow
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true
- name: Login to github registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run GoReleaser
uses: goreleaser/[email protected]
with:
version: latest
args: release --rm-dist
env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Need PAT to write into homebrew-tap repo
GITHUB_TOKEN: ${{ secrets.PAT }}