mirror of
https://github.com/immich-app/data.immich.app.git
synced 2026-09-30 13:23:26 +08:00
50 lines
1.8 KiB
YAML
50 lines
1.8 KiB
YAML
name: Destroy
|
|
on:
|
|
pull_request_target:
|
|
types: [closed]
|
|
|
|
env:
|
|
MISE_TRUSTED_CONFIG_PATHS: ${{ github.workspace }}/.mise/config.toml
|
|
|
|
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
|
|
|
|
- id: token
|
|
uses: immich-app/devtools/actions/create-workflow-token@df46d635b905e618b88fc4c95baa920aeb30b309 # create-workflow-token-action-v3.0.1
|
|
with:
|
|
client-id: ${{ secrets.PUSH_O_MATIC_APP_CLIENT_ID }}
|
|
private-key: ${{ secrets.PUSH_O_MATIC_APP_KEY }}
|
|
permission-contents: read
|
|
|
|
- name: Setup Mise
|
|
uses: immich-app/devtools/actions/use-mise@06a9ef925332c91be647d6256642b86b398592c8 # use-mise-action-v3.2.1
|
|
with:
|
|
github_token: ${{ steps.token.outputs.token }}
|
|
|
|
- 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
|