This repository has been archived by the owner on Oct 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (67 loc) · 2.41 KB
/
deploy.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
name: Deploy
concurrency:
group: ${{ github.event.client_payload.environment }}-${{ github.event.client_payload.component }}
cancel-in-progress: true
on:
repository_dispatch:
types:
- deploy
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- env:
ENVIRONMENT: ${{ github.event.client_payload.environment }}
COMPONENT: ${{ github.event.client_payload.component }}
IMAGE_TAG: ${{ github.event.client_payload.image_tag }}
run: |
echo $ENVIRONMENT
echo $COMPONENT
echo $IMAGE_TAG
- name: Check component
id: check-component
shell: bash
run: |
case ${{ github.event.client_payload.component }} in
ui)
echo "app-dir=sourcify-ui" >> "$GITHUB_OUTPUT"
;;
server)
echo "app-dir=sourcify-server" >> "$GITHUB_OUTPUT"
;;
monitor)
echo "app-dir=sourcify-monitor" >> "$GITHUB_OUTPUT"
;;
repository)
echo "app-dir=sourcify-repository" >> "$GITHUB_OUTPUT"
;;
docs)
echo "app-dir=sourcify-docs" >> "$GITHUB_OUTPUT"
;;
playground)
echo "app-dir=sourcify-playground" >> "$GITHUB_OUTPUT"
;;
verifier-alliance-sync)
echo "app-dir=verifier-alliance-sync" >> "$GITHUB_OUTPUT"
;;
*)
echo "app-dir=unknown" >> "$GITHUB_OUTPUT"
exit 1
;;
esac
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_DISPATCH_TOKEN }}
- name: Update values.yaml
uses: mikefarah/yq@6609ed76ecb69f9d8254345292d90ea72f641715
with:
cmd: >-
yq -i '.image.tag = "${{ github.event.client_payload.image_tag }}"'
"environments/${{ github.event.client_payload.environment }}/applications/${{ steps.check-component.outputs.app-dir }}/values.yaml"
- name: Commit changes
uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081
with:
message: >-
ci(${{ github.event.client_payload.environment }}): update ${{ github.event.client_payload.component }} - ${{ github.event.client_payload.ref }}/${{ github.event.client_payload.sha }}"
default_author: github_actions
pull: '--rebase --autostash'