d6f621a619
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
68 lines
2.0 KiB
YAML
68 lines
2.0 KiB
YAML
name: Deploy Artifact Proxy Prod
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
PROJECT_ID: code-push-prod
|
|
SERVICE: artifact-proxy
|
|
REGION: us-central1
|
|
CONTAINER_REGISTRY: us-docker.pkg.dev
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: packages/artifact_proxy
|
|
|
|
name: ☁️ Artifact Proxy
|
|
|
|
steps:
|
|
- name: 📚 Git Checkout
|
|
uses: actions/checkout@v5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: 🎯 Setup Dart
|
|
uses: dart-lang/setup-dart@v1
|
|
|
|
- name: 🔐 GCloud Auth
|
|
uses: google-github-actions/auth@v2
|
|
with:
|
|
project_id: ${{ env.PROJECT_ID }}
|
|
credentials_json: ${{ secrets.CLOUD_RUN_SA_PROD }}
|
|
export_environment_variables: true
|
|
|
|
- name: ☁️ Setup GCloud SDK
|
|
uses: google-github-actions/setup-gcloud@v3.0.0
|
|
with:
|
|
project_id: ${{ env.PROJECT_ID }}
|
|
|
|
- name: 🔓 Login to Artifact Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.CONTAINER_REGISTRY }}
|
|
username: _json_key
|
|
password: ${{ secrets.CLOUD_RUN_SA_PROD }}
|
|
|
|
- name: 🐳 Build and Push Container
|
|
run: |-
|
|
# Copy pubspec.lock from workspace root into package to retain resolved package versions
|
|
# https://github.com/dart-lang/pub/issues/4594
|
|
cp ${{ github.workspace }}/pubspec.lock .
|
|
docker build -t ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }} .
|
|
docker push ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }}
|
|
|
|
- name: 🚀 Deploy to Cloud Run
|
|
id: deploy
|
|
uses: google-github-actions/deploy-cloudrun@v2.7.4
|
|
with:
|
|
service: ${{ env.SERVICE }}
|
|
image: ${{ env.CONTAINER_REGISTRY }}/${{ env.PROJECT_ID }}/us.gcr.io/${{ env.SERVICE }}:${{ github.sha }}
|
|
region: ${{ env.REGION }}
|
|
|
|
- name: 👀 Show Output
|
|
run: echo ${{ steps.deploy.outputs.url }}
|