Skip to content

Add Playwright integration with Docker setup and initial API routes #153

Add Playwright integration with Docker setup and initial API routes

Add Playwright integration with Docker setup and initial API routes #153

Workflow file for this run

# name: MASTER CI/CD
# on:
# push:
# branches:
# - master
# jobs:
# test:
# name: Test
# permissions:
# contents: 'read'
# id-token: 'write'
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Google Auth
# id: auth
# uses: 'google-github-actions/auth@v1'
# with:
# token_format: 'access_token'
# workload_identity_provider: '${{ secrets.GCP_WIF_PROVIDER }}' # e.g. - projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider
# service_account: '${{ secrets.GCP_WIF_SERVICE_ACCOUNT }}' # e.g. - my-service-account@my-project.iam.gserviceaccount.com
# - name: Start
# env:
# GOOGLE_CLOUD_PROJECT: '${{ steps.auth.outputs.project_id }}'
# GOOGLE_APPLICATION_CREDENTIALS: '${{ steps.auth.outputs.credentials_file_path }}'
# ENVIRONMENT: test
# run: docker compose up api
# - name: Test
# run: echo "THIS IS WHERE PYTEST SHOULD BE CALLED"
# deploy:
# name: Deploy to Cloud Run
# runs-on: ubuntu-latest
# # needs: [build, test]
# env:
# GCP_CLOUDRUN_SERVICE_NAME: ${{ secrets.GCP_CLOUDRUN_SERVICE_NAME }}
# GCP_ARTIFACT_REGISTRY_IMAGE: ${{ secrets.GCP_ARTIFACT_REGISTRY_IMAGE }}
# permissions:
# id-token: 'write'
# contents: 'read'
# steps:
# - name: Checkout master
# uses: actions/checkout@v2
# - id: 'auth'
# name: Authenticate to Google Cloud
# uses: google-github-actions/auth@v0
# with:
# token_format: 'access_token'
# workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }}
# service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
# - name: Authorize Docker push
# run: gcloud auth configure-docker europe-west1-docker.pkg.dev
# - name: Log in to GitHub Packages
# run: echo ${GITHUB_TOKEN} | docker login -u ${GITHUB_ACTOR} --password-stdin docker.pkg.github.com
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Pull image
# run: |
# docker pull ${{ env.IMAGE }}:latest || true
# - name: Set .env file
# run: echo ${{ secrets.ENV_FILE_STAGE }} | base64 --decode > ./src/.env
# - name: Build image
# env:
# ENVIRONMENT: stage
# run: |
# docker build \
# --cache-from ${{ env.IMAGE }}:latest \
# --tag ${{ secrets.GCP_ARTIFACT_REGISTRY_IMAGE }} \
# --file ./src/app.dockerfile \
# "./src"
# - name: Push Container
# run: |
# docker push ${{ secrets.GCP_ARTIFACT_REGISTRY_IMAGE }}
# - id: 'deploy'
# name: Deploy Cloud Run
# uses: google-github-actions/deploy-cloudrun@v0
# with:
# service: ${{ secrets.GCP_CLOUDRUN_SERVICE_NAME}}
# image: ${{ secrets.GCP_ARTIFACT_REGISTRY_IMAGE }}:latest
# region: europe-west1