This repository has been archived by the owner on Nov 25, 2023. It is now read-only.
Switching to non slim #68
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: Continuous Deployment | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
# We only care about the latest revision of a PR, so cancel all previous instances. | |
concurrency: | |
group: cd-${{ github.event.pull_request.number || github.ref_name }} | |
cancel-in-progress: true | |
jobs: | |
create-dockerimage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Configure gcloud | |
run: | | |
gcloud config set project ${{ secrets.GCP_PROJECT_ID }} | |
gcloud auth configure-docker | |
- name: Write GCP Service Account Key to File | |
run: echo "$GCP_SA_KEY" > ./.github/terraform/gcp-sa-key.json | |
env: | |
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} | |
- name: Authenticate with Google Cloud | |
run: gcloud auth activate-service-account --key-file=./.github/terraform/gcp-sa-key.json | |
- name: Create Dockerimage | |
run: docker build -t nutc-linter:latest . | |
- name: Push Docker image | |
run: | | |
docker tag nutc-linter:latest gcr.io/${{ secrets.GCP_PROJECT_ID }}/nutc-linter:latest | |
docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/nutc-linter:latest | |
- name: Deploy to Cloud Run | |
run: > | |
gcloud run deploy nutc-linter | |
--image gcr.io/${{ secrets.GCP_PROJECT_ID }}/nutc-linter:latest | |
--region us-central1 | |
--platform managed | |