-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (57 loc) · 1.94 KB
/
master.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
65
66
67
68
69
70
name: Publish
on:
push:
branches:
- master
jobs:
build-master:
permissions:
id-token: write
contents: read
runs-on: elisa-normal
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: elisa-actions/setup-go-and-mage@v1
- name: Ensure go.mod and go.sum are up to date
run: mage go:tidyAndVerify
- name: Lint
run: mage go:lint
- name: Run license check
run: mage go:licenses
- name: Build binary
run: mage go:build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Google Artifact Registry
uses: docker/login-action@v3
with:
registry: europe-north1-docker.pkg.dev
username: _json_key
password: ${{ secrets.GAR_JSON_KEY }}
- name: Build image
env:
DOCKER_IMAGE_TAGS: latest sha-${{ github.sha }}
run: mage docker:build
- name: Push image
run: mage docker:push
- name: Update batch
env:
GH_TOKEN: ${{ secrets.DOPS_SRE_PAT }}
GH_ORG: elisasre
GH_REPO: batch
REPLACE_REGEX: (europe-north1-docker.pkg.dev/sose-sre-5737/sre-public/kops-autoscaler-openstack:sha-)(.*)
COMMIT_TEXT: update kops-autoscaler-openstack image to {{.SHA}}
FILE_PATH: templates/go/core/kops-autoscaler/deployment.yaml
run: |
curl -s https://${{ secrets.SRE_MEDIA_URL }}/repo-updater/repo-updater -o repo-updater && chmod +x repo-updater
./repo-updater publish
- name: Notify failure
if: failure()
env:
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }}
MATTERMOST_TEXT: "${{ github.repository }} [${{ github.event.ref }}](${{ github.event.repository.html_url }}/tree/${{ github.event.ref }}) build failed."
run: |
send-to-mattermost