Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Destroy NonProd
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolftousen authored Jan 10, 2024
1 parent 174bb79 commit f72f1a3
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/destroy-np.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "Release"
on:
workflow_dispatch:

env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/timebot

jobs:
plan:
name: "Terraform Plan - Destroy"
runs-on: ubuntu-latest
environment:
name: "nonprod"
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/nonprod/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_NONPROD_SUBSCRIPTION_ID }}
TF_VAR_acr_subscription_id: ${{ secrets.AZURE_NONPROD_SUBSCRIPTION_ID }}
TF_VAR_timebot_image: "${{ env.IMAGE_NAME }}:${{ needs.build.outputs.docker_tag }}"
TF_VAR_app_token: ${{ secrets.NONPROD_APP_TOKEN }}
TF_VAR_bot_user_token: ${{ secrets.NONPROD_BOT_TOKEN }}
TF_VAR_harvest_token: ${{ secrets.NONPROD_HARVEST_TOKEN }}
TF_VAR_harvest_id: ${{ secrets.NONPROD_HARVEST_ID }}
TF_VAR_harvest_url: "https://api.harvestapp.com/v2/"
apply:
name: "Terraform Apply - Destroy"
runs-on: ubuntu-latest
environment:
name: "nonprod"
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 to Nonprod
working-directory: infra/terragrunt/nonprod/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_NONPROD_SUBSCRIPTION_ID }}
TF_VAR_acr_subscription_id: ${{ secrets.AZURE_NONPROD_SUBSCRIPTION_ID }}
TF_VAR_timebot_image: "${{ env.IMAGE_NAME }}:${{ needs.build.outputs.docker_tag }}"
TF_VAR_app_token: ${{ secrets.NONPROD_APP_TOKEN }}
TF_VAR_bot_user_token: ${{ secrets.NONPROD_BOT_TOKEN }}
TF_VAR_harvest_token: ${{ secrets.NONPROD_HARVEST_TOKEN }}
TF_VAR_harvest_id: ${{ secrets.NONPROD_HARVEST_ID }}
TF_VAR_harvest_url: "https://api.harvestapp.com/v2/"

0 comments on commit f72f1a3

Please sign in to comment.