|
| 1 | +on: |
| 2 | + workflow_dispatch: |
| 3 | + pull_request: |
| 4 | + |
| 5 | +jobs: |
| 6 | + build_archivematica: |
| 7 | + uses: PermanentOrg/archivematica/.github/workflows/build.yml@main |
| 8 | + secrets: inherit |
| 9 | + |
| 10 | + build_archivematica_storage_service: |
| 11 | + uses: PermanentOrg/archivematica-storage-service/.github/workflows/build.yml@main |
| 12 | + secrets: inherit |
| 13 | + |
| 14 | + deploy_archivematica_staging: |
| 15 | + uses: ./.github/workflows/deploy_archivematica_staging.yml |
| 16 | + secrets: inherit |
| 17 | + |
| 18 | + |
| 19 | + deploy: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + needs: |
| 22 | + - build_archivematica |
| 23 | + - build_archivematica_storage_service |
| 24 | + - deploy_archivematica_staging |
| 25 | + environment: prod |
| 26 | + env: |
| 27 | + ARCHIVEMATICA_DASHBOARD_IMAGE_TAG: ${{ needs.build_archivematica.outputs.ARCHIVEMATICA_DASHBOARD_IMAGE_TAG }} |
| 28 | + ARCHIVEMATICA_MCP_SERVER_IMAGE_TAG: ${{ needs.build_archivematica.outputs.ARCHIVEMATICA_MCP_SERVER_IMAGE_TAG }} |
| 29 | + ARCHIVEMATICA_MCP_CLIENT_IMAGE_TAG: ${{ needs.build_archivematica.outputs.ARCHIVEMATICA_MCP_CLIENT_IMAGE_TAG }} |
| 30 | + ARCHIVEMATICA_STORAGE_SERVICE_IMAGE_TAG: ${{ needs.build_archivematica_storage_service.outputs.ARCHIVEMATICA_STORAGE_SERVICE_IMAGE_TAG }} |
| 31 | + defaults: |
| 32 | + run: |
| 33 | + working-directory: ./archivematica/prod_cluster |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v5 |
| 36 | + - name: Setup Terraform |
| 37 | + uses: hashicorp/setup-terraform@v3 |
| 38 | + with: |
| 39 | + cli_config_credentials_token: ${{ secrets.TERRAFORM_API_TOKEN }} |
| 40 | + - name: Terraform Init |
| 41 | + run: terraform init |
| 42 | + - name: Terraform Validate |
| 43 | + run: terraform validate -no-color |
| 44 | + - name: Terraform Plan |
| 45 | + run: | |
| 46 | + terraform plan -no-color -input=false \ |
| 47 | + -var "image_overrides={ |
| 48 | + \"archivematica-dashboard-prod\" = \"$ARCHIVEMATICA_DASHBOARD_IMAGE_TAG\", |
| 49 | + \"archivematica-mcp-client-prod\" = \"$ARCHIVEMATICA_MCP_CLIENT_IMAGE_TAG\", |
| 50 | + \"archivematica-mcp-server-prod\" = \"$ARCHIVEMATICA_MCP_SERVER_IMAGE_TAG\", |
| 51 | + \"archivematica-storage-service-prod\" = \"$ARCHIVEMATICA_STORAGE_SERVICE_IMAGE_TAG\", |
| 52 | + }" |
| 53 | + - name: Terraform Apply |
| 54 | + run: | |
| 55 | + terraform apply -auto-approve -input=false \ |
| 56 | + -var "image_overrides={ |
| 57 | + \"archivematica-dashboard-prod\" = \"$ARCHIVEMATICA_DASHBOARD_IMAGE_TAG\", |
| 58 | + \"archivematica-mcp-client-prod\" = \"$ARCHIVEMATICA_MCP_CLIENT_IMAGE_TAG\", |
| 59 | + \"archivematica-mcp-server-prod\" = \"$ARCHIVEMATICA_MCP_SERVER_IMAGE_TAG\", |
| 60 | + \"archivematica-storage-service-prod\" = \"$ARCHIVEMATICA_STORAGE_SERVICE_IMAGE_TAG\", |
| 61 | + }" |
0 commit comments