mirror of
https://github.com/immich-app/data.immich.app.git
synced 2026-09-30 13:23:26 +08:00
50 lines
1.6 KiB
YAML
50 lines
1.6 KiB
YAML
name: Destroy
|
|
on:
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
env:
|
|
tofu_version: '1.10.2'
|
|
tg_version: '0.83.0'
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
environment: [ 'dev', 'prod' ]
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
|
|
- name: Install 1Password CLI
|
|
uses: 1password/install-cli-action@1a3160d5e9de1ae0803eaa08a88746f5ae3daa50 # v4.1.0
|
|
|
|
- name: Install Terragrunt
|
|
uses: eLco/setup-terragrunt@d6093fd3d1e651013c072facb41d488602b85fbf # v1.0.4
|
|
with:
|
|
terragrunt_version: ${{ env.tg_version }}
|
|
|
|
- name: 'Install OpenTofu'
|
|
uses: opentofu/setup-opentofu@a1320f892987e89d278cc92dc5adc984fb93aca4 # v2.0.2
|
|
with:
|
|
tofu_version: ${{ env.tofu_version }}
|
|
tofu_wrapper: false
|
|
|
|
- name: Destroy All
|
|
working-directory: ${{ env.working_dir }}
|
|
env:
|
|
ENVIRONMENT: ${{ matrix.environment }}
|
|
TF_VAR_dist_dir: ${{ github.workspace }}/dist
|
|
TF_VAR_stage: pr-${{ github.event.number }}
|
|
OP_SERVICE_ACCOUNT_TOKEN: ${{ matrix.environment == 'prod' && secrets.OP_TF_PROD_ENV || secrets.OP_TF_DEV_ENV }}
|
|
working_dir: 'deployment'
|
|
run: op run --env-file=".env" -- terragrunt run --all destroy --non-interactive -- -refresh=false
|
|
|
|
- name: Comment
|
|
uses: immich-app/devtools/actions/sticky-comment@0135acd12ad9f3369b94a2aa3c0ae8c835a4e926 # sticky-comment-action-v1.0.0
|
|
with:
|
|
id: web-pr-url
|
|
delete: true
|