-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (60 loc) · 1.69 KB
/
ci.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
name: CI
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: golangci/golangci-lint-action@v3
with:
args: --timeout=5m
test:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: google-github-actions/setup-gcloud@v1
with:
install_components: 'cloud-firestore-emulator'
- run: go test -v ./...
release:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
- uses: go-semantic-release/action@v1
id: semrel
with:
hooks: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: google-github-actions/auth@v1
with:
project_id: go-semantic-release
credentials_json: ${{ secrets.GCLOUD_AUTH }}
if: steps.semrel.outputs.version != ''
- uses: google-github-actions/setup-gcloud@v1
if: steps.semrel.outputs.version != ''
- run: ./scripts/docker-build-and-push.sh ${{ steps.semrel.outputs.version }}
if: steps.semrel.outputs.version != ''
- uses: google-github-actions/deploy-cloudrun@v1
with:
service: staging-plugin-registry
region: europe-west1
image: gcr.io/go-semantic-release/plugin-registry:${{ steps.semrel.outputs.version }}
if: steps.semrel.outputs.version != ''