Skip to content

sync

sync #3

Workflow file for this run

---
name: Sync
on:
workflow_run:
workflows: ["Run tests"]
branches: [main]
types:
- completed
permissions:
contents: read
jobs:
sync:
runs-on: ubuntu-latest
# Only sync on successful test runs triggered by push to main (not PRs)
if: >-
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
steps:
- name: Connect to Cloudflare WARP
uses: Boostport/setup-cloudflare-warp@v1
with:
organization: makeitworkcloud
auth_client_id: ${{ secrets.CLOUDFLARE_AUTH_CLIENT_ID }}
auth_client_secret: ${{ secrets.CLOUDFLARE_AUTH_CLIENT_SECRET }}
- 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_username: ${{ secrets.OPENSHIFT_USERNAME }}
openshift_password: ${{ secrets.OPENSHIFT_PASSWORD }}
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.event.workflow_run.head_sha }}"}}}'