mirror of
https://github.com/immich-app/data.immich.app.git
synced 2026-09-30 13:23:26 +08:00
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
|
|
- name: Install 1Password CLI
|
|
uses: 1password/install-cli-action@a5215d3a7f75c1629216c465ea9ab3ab399c4b71 # v4.0.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@847eaa4afeb791b06daa46e8eafa8b1b68d7cfb4 # v2.0.1
|
|
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
|