-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (34 loc) · 1.23 KB
/
Copy pathdeploy-ha.yaml
File metadata and controls
40 lines (34 loc) · 1.23 KB
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
name: deploy
on:
push:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/deploy-test' || github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
- name: build
run: |
pip3 install -r jenkins-requirements.txt
python3 ./freeze_web.py
- name: push to build branch
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git checkout -B build
git add app/build
git commit -m "ci: update build artifacts" || echo "Nothing to commit"
git push origin build --force
trigger:
runs-on: self-hosted
if: ${{ github.ref == 'refs/heads/deploy-test' || github.ref == 'refs/heads/master' }}
steps:
- uses: actions/checkout@v4
- name: Trigger Job
run: |
NS="default"
JOB="ccl-website-sync-${GITHUB_SHA::7}"
kubectl -n "$NS" delete job -l app=ccl-website,created-by=github-runner --ignore-not-found=true
kubectl -n "$NS" create job "$JOB" --from=cronjob/ccl-website-sync
kubectl -n "$NS" label job "$JOB" app=ccl-website created-by=github-runner --overwrite