[Refactor]: unify all notation to camelCase (#114) #37
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: api-CD | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
paths: 'api/**' | |
env: | |
REGION: ${{ secrets.REGION }} | |
SERVICE: ${{ secrets.CLOUD_RUN_API_SERVICE}} | |
jobs: | |
api-CD: | |
name: api-CD | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
runs-on: ubuntu-latest | |
environment: gcp-deploy | |
defaults: | |
run: | |
working-directory: ./api/ | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Google Auth | |
id: auth | |
uses: 'google-github-actions/auth@v1' | |
with: | |
workload_identity_provider: '${{ secrets.WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider | |
service_account: '${{ secrets.WIF_SERVICE_ACCOUNT }}' # e.g. - [email protected] | |
- name: Deploy to Cloud Run | |
id: deploy | |
uses: google-github-actions/deploy-cloudrun@v1 | |
with: | |
service: ${{ env.SERVICE }} | |
region: ${{ env.REGION }} | |
env_vars: | | |
DATABASE_URI=${{ secrets.DATABASE_URI }} | |
MYSQL_DATABASE_URI=${{ secrets.MYSQL_DATABASE_URI }} | |
REDIS_URI=${{ secrets.REDIS_URI }} | |
JWT_SECRET=${{ secrets.JWT_SECRET }} | |
JWT_EXPIRES_IN=${{ secrets.JWT_EXPIRES_IN }} | |
JWT_REFRESH_EXPIRES_IN=${{ secrets.JWT_REFRESH_EXPIRES_IN }} | |
AWS_REGION=${{ secrets.AWS_REGION }} | |
AWS_S3_IMAGE_MAIN_BUCKET=${{ secrets.AWS_S3_IMAGE_MAIN_BUCKET }} | |
MEMORY_CACHE_DEFAULT_TTL=${{ secrets.MEMORY_CACHE_DEFAULT_TTL }} | |
MEMORY_CACHE_DEFAULT_MAX=${{ secrets. MEMORY_CACHE_DEFAULT_MAX }} | |
IMAGE_PROCESS_SERVICE_URL=${{ secrets.IMAGE_PROCESS_SERVICE_URL }} | |
SESSION_EXPIRES_IN=${{ secrets.SESSION_EXPIRES_IN }} | |
FIREBASE_PROJECT_ID=${{ secrets.FIREBASE_PROJECT_ID }} | |
FIREBASE_CLIENT_EMAIL=${{ secrets.FIREBASE_CLIENT_EMAIL }} | |
FIREBASE_PRIVATE_KEY=${{ secrets.FIREBASE_PRIVATE_KEY }} | |
image: ${{ secrets.DOCKER_IMAGE_API_TAG }} | |
# If required, use the Cloud Run url output in later steps | |
- name: Show Output | |
run: echo ${{ steps.deploy.outputs.url }} |