-
Notifications
You must be signed in to change notification settings - Fork 10
42 lines (35 loc) · 1.12 KB
/
gitops_sync.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
name: Sync Changes to GitOps Repo
on:
pull_request:
types: [closed]
workflow_dispatch:
jobs:
sync_changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.DITP_GITOPS_REPO_SECRET }}
- name: Add github.com to known hosts
run: ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Checkout GitOps repo
uses: actions/checkout@v4
with:
repository: bcgov-c/ministry-gitops-ditp
ssh-key: ${{ secrets.DITP_GITOPS_REPO_SECRET }}
sparse-checkout: |
services
path: ministry-gitops-ditp
- name: Copy changes
run: |
rsync -avz --delete ./services/ ./ministry-gitops-ditp/services/
- name: Commit and push changes
run: |
cd ministry-gitops-ditp
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Sync changes from trust-over-ip-configurations" || echo "No changes to commit"
git push