diff --git a/.github/workflows/client.yaml b/.github/workflows/client.yaml index dd0fff7..046121c 100644 --- a/.github/workflows/client.yaml +++ b/.github/workflows/client.yaml @@ -86,8 +86,6 @@ jobs: - name: Capture Environment Variables run: | - echo VITE_AUTH_LOGIN_URL=${{ secrets.STAGING_AUTH_URL }} > .env - echo VITE_AUTH_PROJECT_ID=${{ secrets.STAGING_AUTH_PROJECT_ID }} >> .env echo VITE_GRAPHQL_ENDPOINT=${{ secrets.STAGING_GRAPHQL_ENDPOINT }} >> .env echo VITE_ASL_LEXICON_ID=${{ secrets.STAGING_ASL_LEXICON_ID }} >> .env echo VITE_NAME=${{ secrets.STAGING_ASL_LEX_NAME }} >> .env @@ -108,10 +106,63 @@ jobs: workload_identity_provider: ${{ secrets.GCP_STAGING_ID_PROVIDER }} service_account: ${{ secrets.STAGING_GCP_SERVICE_ACCOUNT }} - - name: Upload Files uses: 'google-github-actions/upload-cloud-storage@v2' with: path: packages/client/dist/ destination: ${{ secrets.GCP_FRONTEND_BUCKET }} parent: false + + eu-prod-deploy: + runs-on: ubuntu-latest + name: Deploy to EU Prod + needs: [lint, build] + permissions: + contents: 'read' + id-token: 'write' + if: startsWith(github.ref, 'refs/tags/v') + defaults: + run: + working-directory: packages/client + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + # App Engine deploy logic does not play well with + - name: Cleanup + run: rm package-lock.json + + - name: Setup NodeJS + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Capture Environment Variables + run: | + echo VITE_GRAPHQL_ENDPOINT=${{ secrets.PROD_EU_GRAPHQL_ENDPOINT }} >> .env + echo VITE_ASL_LEXICON_ID=${{ secrets.PROD_EU_ASL_LEXICON_ID }} >> .env + echo VITE_NAME=${{ secrets.PROD_EU_ASL_LEX_NAME }} >> .env + echo VITE_AUTH_API_KEY=${{ secrets.PROD_EU_AUTH_API_KEY }} >> .env + echo VITE_AUTH_DOMAIN=${{ secrets.PROD_EU_AUTH_DOMAIN }} >> .env + + - name: NPM Install + run: npm install + shell: bash + + - name: Build + run: npm run build + + - name: GCP Auth + uses: 'google-github-actions/auth@v2' + with: + project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }} + workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }} + service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }} + + - name: Upload Files + uses: 'google-github-actions/upload-cloud-storage@v2' + with: + path: packages/client/dist/ + destination: ${{ secrets.PROD_EU_GCP_FRONTEND_BUCKET }} + parent: false diff --git a/.github/workflows/gateway.yaml b/.github/workflows/gateway.yaml index 2d62173..6666ccd 100644 --- a/.github/workflows/gateway.yaml +++ b/.github/workflows/gateway.yaml @@ -96,3 +96,38 @@ jobs: SIGNLAB_URI=${{ secrets.STAGING_SIGNLAB_URI }} LEX_URI=${{ secrets.STAGING_LEX_URI }} AUTH_URI=${{ secrets.STAGING_AUTH_URI }} + + eu-prod-deploy: + runs-on: ubuntu-latest + name: Deploy to Staging + needs: [lint, build] + permissions: + contents: 'read' + id-token: 'write' + if: startsWith(github.ref, 'refs/tags/v') + defaults: + run: + working-directory: packages/gateway + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + # App Engine deploy logic does not play well with + - name: Cleanup + run: rm package-lock.json + + - name: GCP Auth + uses: 'google-github-actions/auth@v2' + with: + project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }} + workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }} + service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }} + + - name: Deploy to Staging + uses: 'google-github-actions/deploy-appengine@v2' + with: + working_directory: 'packages/gateway' + env_vars: |- + SIGNLAB_URI=${{ secrets.PROD_EU_SIGNLAB_URI }} + LEX_URI=${{ secrets.PROD_EU_LEX_URI }} + AUTH_URI=${{ secrets.PROD_EU_AUTH_URI }} diff --git a/.github/workflows/server.yaml b/.github/workflows/server.yaml index 4fcc7ba..65cc20a 100644 --- a/.github/workflows/server.yaml +++ b/.github/workflows/server.yaml @@ -97,3 +97,42 @@ jobs: CASBIN_MONGO_URI=${{ secrets.STAGING_CASBIN_MONGO_URI }} ZIP_JOB_NAME=${{ secrets.GCP_ZIP_JOB_STAGING }} GATEWAY_ENDPOINT=${{ secrets.STAGING_GRAPHQL_ENDPOINT }} + + eu-prod-deploy: + runs-on: ubuntu-latest + name: Deploy to Staging + needs: [lint, build] + permissions: + contents: 'read' + id-token: 'write' + if: startsWith(github.ref, 'refs/tags/v') + defaults: + run: + working-directory: packages/server + + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + # App Engine deploy logic does not play well with + - name: Cleanup + run: rm package-lock.json + + - name: GCP Auth + uses: 'google-github-actions/auth@v2' + with: + project_id: ${{ secrets.GCP_PROD_EU_PROJECT_ID }} + workload_identity_provider: ${{ secrets.GCP_PROD_EU_ID_PROVIDER }} + service_account: ${{ secrets.PROD_EU_GCP_SERVICE_ACCOUNT }} + + - name: Deploy to Staging + uses: 'google-github-actions/deploy-appengine@v2' + with: + working_directory: 'packages/server' + env_vars: |- + MONGO_URI=${{ secrets.PROD_EU_MONGO_URI }} + CASBIN_MONGO_URI=${{ secrets.PROD_EU_CASBIN_MONGO_URI }} + ZIP_JOB_NAME=${{ secrets.GCP_ZIP_JOB_PROD_EU }} + GATEWAY_ENDPOINT=${{ secrets.PROD_EU_GRAPHQL_ENDPOINT }} + +