-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.21 KB
/
ci.yml
File metadata and controls
52 lines (43 loc) · 1.21 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
41
42
43
44
45
46
47
48
49
50
51
52
---
name: CI/CD
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Pre-commit Tests
runs-on: arc
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: pre-commit tests
uses: pre-commit/action@v3.0.1
sync:
name: Sync ArgoCD
runs-on: arc
needs: [test]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Install OpenShift CLI
uses: redhat-actions/oc-installer@v1
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
- name: Sync ArgoCD application
run: |
oc -n openshift-gitops patch application kustomize-cluster \
--type=merge \
-p '{"operation":{"initiatedBy":{"username":"github-actions"},"sync":{"revision":"${{ github.sha }}"}}}'