|
| 1 | +name: Generate diff of Kubernetes changes |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'main' |
| 7 | + paths: |
| 8 | + - '.holo/config.toml' |
| 9 | + - '.holo/sources/jarvus-cluster-template.toml' |
| 10 | + - '.holo/branches/releases/**' |
| 11 | + - '.github/workflows/*-kubernetes.yml' |
| 12 | + - 'ci/**' |
| 13 | + - 'kubernetes/apps/**' |
| 14 | + - 'kubernetes/system/**' |
| 15 | + |
| 16 | +env: |
| 17 | + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} |
| 18 | + |
| 19 | +jobs: |
| 20 | + preview-kubernetes: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + env: |
| 23 | + CLOUDSDK_CORE_PROJECT: cal-itp-data-infra |
| 24 | + GKE_NAME: data-infra-apps |
| 25 | + GKE_REGION: us-west1 |
| 26 | + USE_GKE_GCLOUD_AUTH_PLUGIN: True |
| 27 | + steps: |
| 28 | + # Setup |
| 29 | + - uses: actions/checkout@v4 |
| 30 | + |
| 31 | + - uses: 'google-github-actions/auth@v2' |
| 32 | + with: |
| 33 | + credentials_json: '${{ secrets.GCP_SA_KEY }}' |
| 34 | + - uses: google-github-actions/setup-gcloud@v2 |
| 35 | + - run: gcloud components install gke-gcloud-auth-plugin |
| 36 | + - uses: google-github-actions/get-gke-credentials@v1 |
| 37 | + with: |
| 38 | + cluster_name: ${{ env.GKE_NAME }} |
| 39 | + location: ${{ env.GKE_REGION }} |
| 40 | + - run: curl -sSL https://install.python-poetry.org | python - |
| 41 | + - name: Set up hologit |
| 42 | + env: |
| 43 | + BIO_RELEASE: 1.6.821 |
| 44 | + run: | |
| 45 | + curl -LO "https://github.com/biome-sh/biome/releases/download/v${BIO_RELEASE}/bio-${BIO_RELEASE}-x86_64-linux.tar.gz" |
| 46 | + tar xzvf "bio-${BIO_RELEASE}-x86_64-linux.tar.gz" |
| 47 | + sudo mv bio /usr/local/bin/bio |
| 48 | + sudo bio pkg install --binlink jarvus/hologit |
| 49 | +
|
| 50 | + git config user.name "Github Action $GITHUB_JOB" |
| 51 | + git config user.email "$(whoami)@$(uname -n)" |
| 52 | +
|
| 53 | + # Render Kubernetes content with parent underlay and checkout |
| 54 | + - run: git holo project kubernetes-workspace --commit-to=kubernetes |
| 55 | + - run: git checkout kubernetes |
| 56 | + |
| 57 | + # Diff and write back to PR |
| 58 | + - id: diff |
| 59 | + name: Run poetry invoke |
| 60 | + shell: bash |
| 61 | + working-directory: ci |
| 62 | + run: | |
| 63 | + poetry install |
| 64 | + poetry run invoke secrets -f "./channels/prod.yaml" |
| 65 | + poetry run invoke release -f "./channels/prod.yaml" |
0 commit comments