Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

create static page

create static page #1

Workflow file for this run

name: Static
on:
push:
paths:
- packages/static/**
- Dockerfile.static
- .github/workflows/static.yml
tags:
- v*
pull_request:
paths:
- packages/static/**
- Dockerfile.static
- .github/workflows/static.yml
workflow_dispatch:
defaults:
run:
shell: bash
env:
SERVICE: static
REGION: us-east1
PROJECT: polytinder
ENVIRONMENT: prod
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: cd packages/$SERVICE
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Build
run: |
docker buildx build \
-f Dockerfile.static \
--platform linux/amd64 \
--target prod \
-t $REGION-docker.pkg.dev/$PROJECT/$PROJECT-$ENVIRONMENT/$SERVICE \
.
- name: Configure Docker
run: gcloud auth configure-docker $REGION-docker.pkg.dev
- name: Push
if: startsWith(github.event.ref, 'refs/tags/')
run: docker push $REGION-docker.pkg.dev/$PROJECT/$PROJECT-$ENVIRONMENT/$SERVICE
deploy:
runs-on: ubuntu-latest
needs: [build]
if: startsWith(github.event.ref, 'refs/tags/')
steps:
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- run: |
gcloud run deploy $PROJECT-$ENVIRONMENT-$SERVICE \
--image=$REGION-docker.pkg.dev/$PROJECT/$PROJECT-$ENVIRONMENT/$SERVICE \
--region=$REGION \
--project=$PROJECT
- run: |
gcloud run services update-traffic $PROJECT-$ENVIRONMENT-$SERVICE \
--region=$REGION \
--project=$PROJECT \
--to-latest