CMS Proxy #70
Workflow file for this run
This file contains 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: verify chart' | |
permissions: | |
id-token: write | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
verify-template: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/setup-helm@v3 | |
with: | |
version: v3.13.2 | |
- name: Test with template | |
run: helm template --output-dir generated mycms websight-cms | |
verify-installation: | |
runs-on: ubuntu-latest | |
needs: ['verify-template'] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/setup-helm@v3 | |
with: | |
version: v3.13.2 | |
- name: Authenticate to Google Cloud | |
id: auth | |
uses: google-github-actions/auth@v1 | |
with: | |
token_format: access_token | |
workload_identity_provider: ${{ vars.GCP_DEV_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ vars.GCP_DEV_SERVICE_ACCOUNT_EMAIL }} | |
- name: Set up Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v1' | |
- name: Create infrastructure | |
run: | | |
CLUSTER_NAME=$(./.github/scripts/get-cluster-name.sh ${{ github.ref_name }}) | |
gcloud container clusters create ${CLUSTER_NAME} --num-nodes 1 --zone us-central1-a --machine-type e2-standard-2 | |
# exporting the flag USE_GKE_GCLOUD_AUTH_PLUGIN and installing gke-gcloud-auth-plugin is required | |
# see: https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke | |
- name: Install and test chart | |
run: | | |
export USE_GKE_GCLOUD_AUTH_PLUGIN=True | |
gcloud components install gke-gcloud-auth-plugin | |
CLUSTER_NAME=$(./.github/scripts/get-cluster-name.sh ${{ github.ref_name }}) | |
gcloud container clusters get-credentials --zone us-central1-a "$CLUSTER_NAME" --project=${{ vars.GCP_DEV_PROJECT_ID }} | |
.github/scripts/ci-helm-install-and-test.sh | |
- name: Delete infrastructure | |
if: always() | |
run: | | |
CLUSTER_NAME=$(./.github/scripts/get-cluster-name.sh ${{ github.ref_name }}) | |
gcloud container clusters delete ${CLUSTER_NAME} --zone us-central1-a --quiet |