Skip to content

chore(OVH): delete environment when it gets tear down #102

chore(OVH): delete environment when it gets tear down

chore(OVH): delete environment when it gets tear down #102

Workflow file for this run

name: Deployment
on:
push:
branches:
- website
pull_request_target:
types: [opened, synchronize, reopened, closed, labeled]
workflow_dispatch:
jobs:
deploy:
if: github.event_name == 'push' || (github.event.action != 'closed' && github.event.action != 'labeled')
uses: ./.github/workflows/ovh.yaml
with:
environment_name: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && 'production' || format('pull/{0}', github.event.pull_request.number) }}
url: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && format('https://{0}', vars.MAIN_WEBSITE) || format('https://{0}/pr/{1}', vars.PREVIEW_WEBSITE, github.event.pull_request.number) }}
target: ${{ contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) && 'www' || format('pulls/pr/{0}', github.event.pull_request.number) }}
action: deploy
secrets: inherit
cleanup:
if: |
github.event_name == 'pull_request_target' && (github.event.action == 'closed' || contains(github.event.pull_request.labels.*.name, 'stale'))
uses: ./.github/workflows/ovh.yaml
with:
environment_name: ${{ format('pull/{0}', github.event.pull_request.number) }}
target: ${{ format('pulls/pr/{0}', github.event.pull_request.number) }}
action: teardown
secrets: inherit