Skip to content

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

Remove old staging deployments (#2088)

Zack Krida77dc0b5ea091
diff --git a/.github/actions/staging-frontend-deploy/action.yml b/.github/actions/staging-frontend-deploy/action.yml
deleted file mode 100644
index 1cc93bf5a..000000000
--- a/.github/actions/staging-frontend-deploy/action.yml
+++ /dev/null
@@ -1,157 +0,0 @@
-### !!!
-# This file is automatically generated using Terraform.
-# Do not update it manually. If changes need to be made,
-# please request help from a maintainer to generate the
-# updated version.
-### !!!
-
-name: openverse/staging-frontend-nuxt-deploy
-description: Update the task definition for a staging-frontend-nuxt deployment
-
-inputs:
- tag:
- required: true
- description: Image tag to deploy.
- aws-access-key-id:
- required: true
- aws-secret-access-key:
- required: true
- slack-webhook:
- required: true
- gh-slack-username-map:
- required: true
-
-runs:
- using: "composite"
-
- steps:
- - name: Set the Slack user
- shell: python
- env:
- GH_SLACK_USERNAME_MAP: ${{ inputs.gh-slack-username-map }}
- run: |
- import json
- import os
- mapping = json.loads('${{ env.GH_SLACK_USERNAME_MAP }}')
- github_user = "${{ github.triggering_actor }}"
- slack_id = mapping[github_user]
- with open(os.getenv('GITHUB_ENV'), "a") as env_file:
- env_file.write(f"SLACK_USER_ID={slack_id}")
-
- - name: Notify deployment start
- uses: slackapi/[email protected]
- if: success() || failure()
- with:
- payload: |
- {
- "text": "Starting deployment of staging-frontend",
- "blocks": [
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": ":spinning-cd: A deployment of staging-frontend triggered by <@${{ env.SLACK_USER_ID }}> is starting using the `${{ inputs.tag }}` tag."
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to monitor the deployment>."
- }
- }
- ]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
-
- - name: Configure AWS credentials
- uses: aws-actions/configure-aws-credentials@v1
- if: success() || failure()
- with:
- aws-access-key-id: ${{ inputs.aws-access-key-id }}
- aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
- aws-region: us-east-1
-
- - name: Download task definition template and update family name
- shell: bash
- run: |
- aws ecs describe-task-definition \
- --task-definition staging-frontend-template \
- --query taskDefinition > task-definition.json
-
- # Remove template from the family name (the render action does not support this)
- sed -i 's/"family": "staging-frontend-template"/"family": "staging-frontend"/g' task-definition.json
-
- - name: Fill in the new image ID in the Amazon ECS task definition
- id: task-def
- uses: aws-actions/amazon-ecs-render-task-definition@v1
- with:
- task-definition: task-definition.json
- container-name: nuxt
- image: ghcr.io/wordpress/openverse-frontend:${{ inputs.tag }}
-
- - name: Deploy Amazon ECS task definition
- uses: aws-actions/amazon-ecs-deploy-task-definition@v1
- with:
- task-definition: ${{ steps.task-def.outputs.task-definition }}
- service: staging-frontend
- cluster: staging-default
- wait-for-service-stability: true
- wait-for-minutes: 10
-
- - name: Notify deployment finished
- uses: slackapi/[email protected]
- with:
- payload: |
- {
- "text": "Deployment of staging-frontend successful",
- "blocks": [
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": ":tadaco: The deployment of staging-frontend triggered by <@${{ env.SLACK_USER_ID }}> using the `${{ inputs.tag }}` tag *succeeded*."
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to review the completed deployment workflow>."
- }
- }
- ]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
-
- - name: Notify deployment failure
- if: failure()
- uses: slackapi/[email protected]
- with:
- payload: |
- {
- "text": "Deployment of staging-frontend failed!",
- "blocks": [
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": ":alert: The deployment of staging-frontend triggered by <@${{ env.SLACK_USER_ID }}> using the `${{ inputs.tag }}` tag *failed* :alert:"
- }
- },
- {
- "type": "section",
- "text": {
- "type": "mrkdwn",
- "text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here to review the failed deployment workflow>."
- }
- }
- ]
- }
- env:
- SLACK_WEBHOOK_URL: ${{ inputs.slack-webhook }}
- SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml
index dc080466f..8ce051ba2 100644
--- a/.github/workflows/ghcr.yml
+++ b/.github/workflows/ghcr.yml
@@ -84,24 +84,6 @@ jobs:
build-args: |
RELEASE=${{ steps.get-version.outputs.version }}
- # TODO: Remove once this install redirects to the new one.
- deploy-old-staging:
- name: Deploy old staging frontend
- runs-on: ubuntu-latest
- if: github.event_name == 'push'
- needs: push-to-ghcr
-
- steps:
- - uses: actions/checkout@v3
-
- - uses: ./.github/actions/staging-frontend-deploy
- with:
- tag: ${{ needs.push-to-ghcr.outputs.pushed-version }}
- 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 }}
-
deploy-staging:
name: Deploy staging frontend
runs-on: ubuntu-latest
diff --git a/.github/workflows/rollback.yml b/.github/workflows/rollback.yml
index 8e744c1e5..a9bd28b9d 100644
--- a/.github/workflows/rollback.yml
+++ b/.github/workflows/rollback.yml
@@ -83,16 +83,6 @@ jobs:
slack-webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
gh-slack-username-map: ${{ secrets.GH_SLACK_USERNAME_MAP }}
- # TODO: Remove once this install redirects to the new one.
- - uses: ./.github/actions/staging-frontend-deploy
- if: inputs.environment == 'staging'
- with:
- tag: ${{ inputs.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 }}
-
- uses: ./.github/actions/staging-deploy
if: inputs.environment == 'staging'
with:
diff --git a/DEPLOYMENT.md b/DEPLOYMENT.md
index 2a2ef0faa..64b42b090 100644
--- a/DEPLOYMENT.md
+++ b/DEPLOYMENT.md
@@ -2,7 +2,7 @@
| Environment | Deployment Log | URL | Version Endpoint[^versions] |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
-| Staging | [Staging Deployment Log](https://github.com/WordPress/openverse-frontend/actions/workflows/ghcr.yml?query=branch%3Amain+event%3Apush) | <https://search-staging.openverse.engineering> | [Staging version](https://search-staging.openverse.engineering/version.json) |
+| Staging | [Staging Deployment Log](https://github.com/WordPress/openverse-frontend/actions/workflows/ghcr.yml?query=branch%3Amain+event%3Apush) | <https://staging.openverse.org> | [Staging version](https://staging.openverse.org/version.json) |
| Production | [Production Deployment Log](https://github.com/WordPress/openverse-frontend/actions/workflows/ghcr.yml?query=event%3Arelease) | <https://search-production.openverse.engineering>[^production] | [Production version](https://search-production.openverse.engineering/version.json) |
[^versions]:
diff --git a/TESTING_GUIDELINES.md b/TESTING_GUIDELINES.md
index e7bae6d5e..eac98a5c1 100644
--- a/TESTING_GUIDELINES.md
+++ b/TESTING_GUIDELINES.md
@@ -14,7 +14,7 @@ application locally. If you want to just generally test the application in its
current state (i.e., what exists on `main` as opposed to what has actually been
deployed to production) you can find the staging deployment here:
-https://search-staging.openverse.engineering
+https://staging.openverse.org
Staging is redeployed everytime we merge to the `main` branch, so if you're
looking to test the latest version of the app without going through the local