-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (47 loc) · 1.55 KB
/
pr.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
name: dev-release
on: pull_request
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up Go
uses: actions/setup-go@master
with:
go-version: 1.17.x
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
id: ref_slug
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v4
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist --timeout=1h
env:
VERSION: ${{ steps.ref_slug.outputs.github-ref-name }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: set up buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: build (and publish) main image
env:
DOCKER_REPO: ghcr.io/${{ github.repository_owner }}/gitlab-runner-operator
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--build-arg VERSION=pr-${GITHUB_REF_SLUG//-merge/} \
--push \
-t ${DOCKER_REPO}:pr-${GITHUB_REF_SLUG//-merge/} .