-
Notifications
You must be signed in to change notification settings - Fork 31
64 lines (64 loc) · 2.09 KB
/
workflow.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
name: Linux Docker build & Alby CD
on:
push:
release:
types: [published]
jobs:
build:
env:
REGISTRY: ghcr.io
IMAGENAME: ${{ github.event.repository.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out code
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: 1.20.x
- name: Checkout code
uses: actions/checkout@v2
- name: Run tests
run: go test
- name: Docker build
uses: mr-smithers-excellent/docker-build-push@v6
id: build
with:
image: ${{ env.IMAGENAME }}
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout deployment repo
uses: actions/checkout@v2
with:
repository: getalby/alby-deployment
path: infrastructure
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# Always update dev environment
- name: Update dev environment
if: ${{ github.ref == 'refs/heads/main' }}
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: 'alby-simnet-deployment/values.yaml'
propertyPath: 'nwc.image.tag'
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: 'CD: Update nwc tag to ${{ steps.build.outputs.tags }}'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure
# Only update prod environment if this action was triggered by a new tag
- name: Update production environment
if: startsWith(github.ref, 'refs/tags')
uses: fjogeleit/yaml-update-action@v0.7.0
with:
valueFile: 'alby-mainnet-deployment/values.yaml'
propertyPath: 'nwc.image.tag'
value: ${{ steps.build.outputs.tags }}
repository: getalby/alby-deployment
branch: main
createPR: false
message: 'CD: Update nwc tag to ${{ steps.build.outputs.tags }}'
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
workDir: infrastructure