Promote Docs Staging to Production #153
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Terraform Action to promote content and redirects from staging to production | |
name: Promote Docs Staging to Production | |
on: | |
workflow_dispatch: | |
jobs: | |
content: | |
runs-on: ubuntu-20.04 | |
permissions: write-all | |
defaults: | |
run: | |
working-directory: scripts/redirect_creation | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ADMIN_GITHUB_OIDC_ROLE_ARN_DOCS }} | |
aws-region: us-east-1 | |
- name: Promote Staging Content to Production | |
run: | |
aws s3 sync s3://stage-docsstageliquibasecom-origin/ s3://prod-docsliquibasecom-origin/ --delete --exclude "robots.txt" | |
redirects: | |
runs-on: ubuntu-20.04 | |
permissions: write-all | |
env: | |
TF_VAR_env: "prod" | |
SPACELIFT_API_KEY_ENDPOINT: ${{ secrets.SPACELIFT_API_KEY_ENDPOINT }} | |
SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }} | |
SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }} | |
defaults: | |
run: | |
working-directory: scripts/redirect_creation | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install spacectl | |
uses: spacelift-io/setup-spacectl@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ADMIN_GITHUB_OIDC_ROLE_ARN_DOCS }} | |
aws-region: us-east-1 | |
- name: Deploy infrastructure | |
run: | | |
spacectl stack set-current-commit --id liquibase-docs-prod --sha ${{ github.sha }} | |
spacectl stack deploy --id liquibase-docs-prod --auto-confirm |