👥 Deploy Re:Earth Accounts prod #3
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 Re:Earth Accounts prod | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE_NAME_GHCR: ghcr.io/eukarya-inc/plateau-view-3.0/reearth-accounts-api:latest | |
IMAGE_NAME_GCP: asia-northeast1-docker.pkg.dev/reearth-plateau/reearth-plateau/reearth-accounts-api:latest | |
concurrency: | |
group: ${{ github.workflow }} | |
jobs: | |
deploy_server: | |
runs-on: ubuntu-latest | |
environment: prod | |
permissions: | |
id-token: write | |
packages: write | |
if: ${{ github.event.repository.full_name == 'eukarya-inc/PLATEAU-VIEW-3.0' }} | |
steps: | |
- name: Log in to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
- name: Configure docker for GCP | |
run: gcloud auth configure-docker asia-northeast1-docker.pkg.dev --quiet | |
- name: Pull docker image from GitHub Container Registry | |
run: docker pull $IMAGE_NAME_GHCR | |
- name: Tag docker images for Google Cloud | |
run: docker tag $IMAGE_NAME_GHCR $IMAGE_NAME_GCP | |
- name: Push docker images to Google Cloud | |
run: docker push $IMAGE_NAME_GCP | |
- name: Deploy to Cloud Run | |
run: | | |
gcloud run deploy reearth-accounts-api \ | |
--image $IMAGE_NAME_GCP \ | |
--region ${{ vars.GCP_REGION }} \ | |
--platform managed \ | |
--quiet |