This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
Destroy #2
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
name: "Destroy" | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/timebot | |
jobs: | |
plan: | |
name: "Terraform Plan - Destroy" | |
runs-on: ubuntu-latest | |
environment: | |
name: "prod-plan" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Terragrunt | |
run: | | |
wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.54.12/terragrunt_linux_amd64 | |
sudo mv terragrunt_linux_amd64 /usr/local/bin/terragrunt | |
sudo chmod +x /usr/local/bin/terragrunt | |
- name: Plan Timebot Destroy | |
working-directory: infra/terragrunt/prod/timebot/ | |
run: | | |
terragrunt plan -destroy | |
env: | |
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
ARM_TENANT_ID: "1b4a4fed-fed8-4823-a8a0-3d5cea83d122" | |
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_PROD_SUBSCRIPTION_ID }} | |
TF_VAR_acr_subscription_id: ${{ secrets.AZURE_PROD_SUBSCRIPTION_ID }} | |
TF_VAR_timebot_image: "${{ env.IMAGE_NAME }}:${{ needs.build.outputs.docker_tag }}" | |
TF_VAR_app_token: ${{ secrets.PROD_PLAN_APP_TOKEN }} | |
TF_VAR_bot_user_token: ${{ secrets.PROD_PLAN_BOT_TOKEN }} | |
TF_VAR_harvest_token: ${{ secrets.PROD_HARVEST_TOKEN }} | |
TF_VAR_harvest_id: ${{ secrets.PROD_HARVEST_ID }} | |
TF_VAR_harvest_url: "https://api.harvestapp.com/v2/" | |
apply: | |
name: "Terraform Prod Apply" | |
runs-on: ubuntu-latest | |
environment: | |
name: "prod" | |
needs: [plan] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Terragrunt | |
run: | | |
wget https://github.com/gruntwork-io/terragrunt/releases/download/v0.54.12/terragrunt_linux_amd64 | |
sudo mv terragrunt_linux_amd64 /usr/local/bin/terragrunt | |
sudo chmod +x /usr/local/bin/terragrunt | |
- name: Destroy Timebot | |
working-directory: infra/terragrunt/prod/timebot/ | |
run: | | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
env: | |
ARM_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} | |
ARM_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | |
ARM_TENANT_ID: "1b4a4fed-fed8-4823-a8a0-3d5cea83d122" | |
ARM_SUBSCRIPTION_ID: ${{ secrets.AZURE_PROD_SUBSCRIPTION_ID }} | |
TF_VAR_acr_subscription_id: ${{ secrets.AZURE_PROD_SUBSCRIPTION_ID }} | |
TF_VAR_timebot_image: "${{ env.IMAGE_NAME }}:${{ needs.build.outputs.docker_tag }}" | |
TF_VAR_app_token: ${{ secrets.PROD_APP_TOKEN }} | |
TF_VAR_bot_user_token: ${{ secrets.PROD_BOT_TOKEN }} | |
TF_VAR_harvest_token: ${{ secrets.PROD_HARVEST_TOKEN }} | |
TF_VAR_harvest_id: ${{ secrets.PROD_HARVEST_ID }} | |
TF_VAR_harvest_url: "https://api.harvestapp.com/v2/" |