Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Dispatch deployment workflows from infrastructure repository (#1865)

sarayourfriend22aa93a227d0
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index 4c13bdc0c..d3b10a247 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -830,17 +830,20 @@ jobs:
- get-image-tag
- publish-images
steps:
- - name: Checkout repository
- uses: actions/checkout@v3
-
- - name: Dispatch workflow
- run: |
- gh workflow run \
- -f tag=${{ needs.get-image-tag.outputs.image_tag }} \
- -f actor=${{ github.actor }} \
- "Deployment - staging-nuxt"
- env:
- GITHUB_TOKEN: ${{ github.token }}
+ - name: Deploy staging frontend
+ uses: felixp8/[email protected]
+ with:
+ owner: WordPress
+ repo: openverse-infrastructure
+ token: ${{ secrets.ACCESS_TOKEN }}
+ event_type: deploy_staging_nuxt
+ client_payload: |
+ {
+ "actor": "${{ github.actor }}",
+ "tag": "${{ needs.get-image-tag.outputs.image_tag }}"
+ }
+ wait_time: 60 # check every minute
+ max_time: 1800 # allow up to 30 minutes for a deployment
deploy-api:
name: Deploy staging API
@@ -855,17 +858,20 @@ jobs:
- get-image-tag
- publish-images
steps:
- - name: Checkout repository
- uses: actions/checkout@v3
-
- - name: Dispatch workflow
- run: |
- gh workflow run \
- -f tag=${{ needs.get-image-tag.outputs.image_tag }} \
- -f actor=${{ github.actor }} \
- "Deployment - staging-api"
- env:
- GITHUB_TOKEN: ${{ github.token }}
+ - name: Deploy staging API
+ uses: felixp8/[email protected]
+ with:
+ owner: WordPress
+ repo: openverse-infrastructure
+ token: ${{ secrets.ACCESS_TOKEN }}
+ event_type: deploy_staging_api
+ client_payload: |
+ {
+ "actor": "${{ github.actor }}",
+ "tag": "${{ needs.get-image-tag.outputs.image_tag }}"
+ }
+ wait_time: 60 # check every minute
+ max_time: 1800 # allow up to 30 minutes for a deployment
################
# Notification #
diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml
index 5c5b2a34a..3827967c0 100644
--- a/.github/workflows/release-app.yml
+++ b/.github/workflows/release-app.yml
@@ -156,22 +156,24 @@ jobs:
body: |
This changelog PR was automatically generated for @${{ github.actor }} as a result of the ${{ github.workflow }} workflow.
- - name: Deploy production api
- if: inputs.app == 'api'
- run: |
- gh workflow run \
- -f tag=${{ steps.tag.outputs.image-tag }} \
- -f actor=${{ github.actor }} \
- "Deployment - production-api"
- env:
- GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
-
- - name: Deploy production frontend
- if: inputs.app == 'frontend'
- run: |
- gh workflow run \
- -f tag=${{ steps.tag.outputs.image-tag }} \
- -f actor=${{ github.actor }} \
- "Deployment - production-nuxt"
- env:
- GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
+ - name: Deploy production application
+ if: inputs.app == 'frontend' || inputs.app == 'api'
+ uses: felixp8/[email protected]
+ with:
+ owner: WordPress
+ repo: openverse-infrastructure
+ token: ${{ secrets.ACCESS_TOKEN }}
+ event_type: deploy_production_${{ inputs.app == 'frontend' && 'nuxt' || inputs.app }}
+ client_payload: |
+ {
+ "actor": "${{ github.actor }}",
+ "tag": "${{ steps.tag.outputs.image-tag }}"
+ }
+ wait_time: 60 # check every minute
+ max_time: 1800 # allow up to 30 minutes for a deployment
+ # max_time can't easily be configured per application
+ # without duplicating information between our infrastructure
+ # and this workflow. The upstream workflows already have
+ # timeouts appropriately configured and will all fail before 30
+ # minutes is reached. On the other hand, we do want to wait
+ # so that there is a record of the successful deployment.