gcp auth #19
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: gcp-auth-script | |
on: | |
push: | |
branches: | |
- ci-testing | |
- main | |
- release/* #ToDo: add a release branch | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
activate-vm: | |
runs-on: ubuntu-latest | |
steps: | |
- id: 'auth' | |
uses: 'google-github-actions/[email protected]' | |
with: | |
credentials_json: '${{ secrets.GCP_AUTH }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
with: | |
version: '>= 363.0.0' | |
- name: 'Start VM instance' | |
run: 'gcloud compute instances start demos-tests --zone us-central1-a' | |
- name: 'SSH into the instance' | |
run: | | |
gcloud compute ssh demos-tests --quiet --zone us-central1-a --command "cd actions-runner; ./run.sh >/dev/null 2>&1" | |
run-test: | |
needs: activate-vm | |
runs-on: self-hosted | |
steps: | |
- name: Checkout Demos🛎 | |
uses: actions/checkout@v2 | |
with: | |
path: demos | |
persist-credentials: false | |
submodules: "recursive" | |
fetch-depth: 1 | |
- name: Run Demo Testing | |
run: | | |
echo "testing things out!" | |
deactivate-vm: | |
needs: run-test | |
runs-on: ubuntu-latest | |
steps: | |
- id: 'auth' | |
uses: 'google-github-actions/[email protected]' | |
with: | |
credentials_json: '${{ secrets.GCP_AUTH }}' | |
- name: 'Set up Cloud SDK' | |
uses: 'google-github-actions/setup-gcloud@v1' | |
with: | |
version: '>= 363.0.0' | |
- name: 'Stop VM instance' | |
run: 'gcloud compute instances stop demos-tests --zone us-central1-a' | |