Deploy Artifact Proxy Prod #20
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: 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@v4 | |
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/[email protected] | |
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: |- | |
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/[email protected] | |
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 }} |