-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 2.32 KB
/
dsm-update.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# Do not edit. This file was generated via the "workflow" command line tool.
# More information about the tool can be found at github.com/xh3b4sd/workflow.
#
# workflow create dsmupdate -r apiserver
#
name: "dsm-update"
on:
push:
branches:
- "main"
- "master"
jobs:
dsm-update:
runs-on: "ubuntu-latest"
steps:
- name: "Setup Git Project"
uses: "actions/checkout@v2.4.0"
- name: "Setup Go Env"
uses: "actions/setup-go@v2"
with:
go-version: "1.16.2"
- name: "Decrypt Private Key"
run: |
go get github.com/xh3b4sd/red
red decrypt -i .github/asset/venturemark/flux/id_rsa.enc -o .github/asset/venturemark/flux/id_rsa -p '${{ secrets.RED_GPG_PASS_VENTUREMARK_FLUX }}'
- name: "Setup SSH Agent"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a ${SSH_AUTH_SOCK} > /dev/null
chmod 0600 .github/asset/venturemark/flux/id_rsa
ssh-add .github/asset/venturemark/flux/id_rsa
- name: "Clone Go Code"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: git clone git@github.com:venturemark/flux.git "${{ runner.temp }}/venturemark/flux/"
- name: "Setup Git Config"
working-directory: "${{ runner.temp }}/venturemark/flux/"
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin git@github.com:venturemark/flux.git
- name: "Update Project Version"
working-directory: "${{ runner.temp }}/venturemark/flux/"
run: |
go get github.com/xh3b4sd/dsm
dsm update -r HelmRelease -n apiserver -k spec.values.image.tag -v ${{ github.sha }}
- name: "Commit And Push"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
working-directory: "${{ runner.temp }}/venturemark/flux/"
run: |
if [[ $(git status --porcelain) ]]; then
git add .
git commit -m 'update apiserver version'
git push
fi
- name: "Cleanup Build Container"
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-add -D
rm -Rf *