fix: reuse existing cloudflare tunnel across cluster rebuilds #129
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| 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-dind | |
| container: | |
| image: python:3.12 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install git | |
| run: | | |
| apt-get update | |
| apt-get install -y git | |
| - 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 }}"}}}' |