-
Notifications
You must be signed in to change notification settings - Fork 54
40 lines (36 loc) · 1.11 KB
/
Copy pathdeploy-docs.yml
File metadata and controls
40 lines (36 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Deploy Docs
on:
push:
branches:
- docs-release
- release
workflow_dispatch:
env:
REGION: us-central1
GAR_HOSTNAME: us-central1-docker.pkg.dev
PROJECT_ID: drivecore-primary
SERVICE_NAME: mycoder-docs
jobs:
deploy:
name: Deploy to Cloud Run
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- uses: google-github-actions/setup-gcloud@v2
- run: gcloud auth configure-docker $GAR_HOSTNAME --quiet
- run: echo "IMAGE_PATH=$GAR_HOSTNAME/$PROJECT_ID/shared-docker-registry/$SERVICE_NAME:${{ github.sha }}" >> $GITHUB_ENV
- run: |
docker build -t ${{ env.IMAGE_PATH }} -f ./packages/docs/Dockerfile .
docker push ${{ env.IMAGE_PATH }}
- uses: google-github-actions/deploy-cloudrun@v2
with:
service: ${{ env.SERVICE_NAME }}
region: ${{ env.REGION }}
image: ${{ env.IMAGE_PATH }}
flags: '--allow-unauthenticated'