Skip to content

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

Deploy frontend to staging

Dhruv Bhanushali642c559fbf1e
diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml
index 0217a07ce..5439e41cc 100644
--- a/.github/workflows/ci_cd.yml
+++ b/.github/workflows/ci_cd.yml
@@ -10,6 +10,11 @@ on:
types:
- published
workflow_dispatch:
+ input:
+ image_tag:
+ description: "The tag to assign to the images built in the workflow."
+ type: string
+ required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'release' && 'release' || github.ref }}
@@ -33,7 +38,9 @@ jobs:
- name: Get image tag
id: get-image-tag
run: |
- if [[ "${{ github.event_name }}" == "release" ]]; then
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "image-tag=${{ inputs.image_tag }}" >> "$GITHUB_OUTPUT"
+ elif [[ "${{ github.event_name }}" == "release" ]]; then
echo "image-tag=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
else
echo "image-tag=${{ github.sha }}" >> "$GITHUB_OUTPUT"
@@ -827,3 +834,32 @@ jobs:
docker tag openverse-${{ matrix.image }} \
ghcr.io/wordpress/openverse-${{ matrix.image }}:${{ needs.get-image-tag.outputs.image-tag }}
docker push --all-tags ghcr.io/wordpress/openverse-${{ matrix.image }}
+
+ ##############
+ # Deployment #
+ ##############
+
+ deploy-frontend:
+ name: Deploy staging frontend
+ runs-on: ubuntu-latest
+ if: github.event_name == 'push'
+ needs:
+ - get-image-tag
+ - nuxt-build
+ - nuxt-playwright-e2e
+ - nuxt-playwright-vr
+ - storybook-playwright
+ - publish-images
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Deploy to staging
+ uses: ./.github/actions/staging-nuxt-deploy
+ with:
+ tag: ${{ needs.get-image-tag.outputs.image-tag }}
+ aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
+ aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
+ slack-webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
+ gh-slack-username-map: ${{ secrets.GH_SLACK_USERNAME_MAP }}