Deploy Artifact Proxy Prod #18
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 | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: packages/artifact_proxy | |
name: ☁️ Artifact Proxy | |
steps: | |
- name: 📚 Git Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: dart-lang/setup-dart@v1 | |
- name: Setup Cloud SDK | |
uses: google-github-actions/setup-gcloud@v0.2.0 | |
with: | |
project_id: ${{ env.PROJECT_ID }} | |
service_account_key: ${{ secrets.CLOUD_RUN_SA_PROD }} | |
export_default_credentials: true | |
- name: Authorize Docker Push | |
run: gcloud auth configure-docker | |
- name: Build and Push Container | |
run: |- | |
docker build -t gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }} . | |
docker push gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }} | |
- name: Deploy to Cloud Run | |
id: deploy | |
uses: google-github-actions/deploy-cloudrun@v0.4.0 | |
with: | |
service: ${{ env.SERVICE }} | |
image: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE }}:${{ github.sha }} | |
region: ${{ env.REGION }} | |
- name: Show Output | |
run: echo ${{ steps.deploy.outputs.url }} |