Skip to content

v0.25.0

v0.25.0 #47

Workflow file for this run

name: Deploy to prod
on:
workflow_dispatch:
release:
types: [published]
jobs:
generate_image_tags:
uses: ./.github/workflows/generate_image_tags.yml
secrets: inherit
deploy_staging:
uses: ./.github/workflows/staging_deploy.yml
secrets: inherit
deploy_prod:
needs:
- deploy_staging
- generate_image_tags
runs-on: ubuntu-20.04
environment: prod
env:
API_IMAGE_TAG: ${{ needs.generate_image_tags.outputs.API_IMAGE_TAG }}
AM_CLEANUP_IMAGE_TAG: ${{ needs.generate_image_tags.outputs.AM_CLEANUP_IMAGE_TAG }}
RECORD_THUMBNAIL_LAMBDA_IMAGE_TAG: ${{ needs.generate_image_tags.outputs.RECORD_THUMBNAIL_LAMBDA_IMAGE_TAG }}
THUMBNAIL_REFRESH_IMAGE_TAG: ${{ needs.generate_image_tags.outputs.THUMBNAIL_REFRESH_IMAGE_TAG }}
defaults:
run:
working-directory: ./terraform/prod_cluster
steps:
- uses: actions/checkout@v3
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
cli_config_credentials_token: ${{ secrets.TERRAFORM_API_TOKEN }}
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Validate
id: validate
run: terraform validate -no-color
- name: Terraform Plan
id: plan
run: |
terraform plan -no-color -input=false \
-var="stela_image=$API_IMAGE_TAG" \
-var="archivematica_cleanup_image=$AM_CLEANUP_IMAGE_TAG" \
-var="record_thumbnail_lambda_image=$RECORD_THUMBNAIL_LAMBDA_IMAGE_TAG" \
-var="thumbnail_refresh_image=$THUMBNAIL_REFRESH_IMAGE_TAG"
- name: Terraform Apply
run: |
terraform apply -auto-approve -input=false \
-var="stela_image=$API_IMAGE_TAG" \
-var="archivematica_cleanup_image=$AM_CLEANUP_IMAGE_TAG" \
-var="record_thumbnail_lambda_image=$RECORD_THUMBNAIL_LAMBDA_IMAGE_TAG" \
-var="thumbnail_refresh_image=$THUMBNAIL_REFRESH_IMAGE_TAG"