Update main.go #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Destroy branch environment | |
# only trigger on pull request closed events | |
on: | |
pull_request: | |
types: [ closed ] | |
env: | |
OCTOPUS_SPACE: 'SHIPPED23' | |
jobs: | |
destroy-branch-environment: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
steps: | |
- name: Get branch name | |
id: branch-name | |
uses: tj-actions/branch-names@v7 | |
- name: Login to Octopus 🐙 | |
uses: OctopusDeploy/login@v1 | |
with: | |
server: https://michrich.octopus.app | |
service_account_id: 1269d528-af54-4ab9-8a4b-902ac894a865 | |
- name: Deprovision branch environment 🐙 | |
id: deprovision-branch-environment | |
uses: OctopusDeploy/run-runbook-action@v3 | |
with: | |
project: 'SHIPPED23' | |
runbook: 'Destroy branch environment' | |
variables: | | |
Branch:${{needs.build-and-push-image.outputs.branch}} | |
environments: | | |
Branch Template | |
- name: Wait for environment to deprovision 🐙 | |
uses: OctopusDeploy/await-task-action@v3 | |
with: | |
server_task_id: ${{ fromJson(steps.deprovision-branch-environment.outputs.server_tasks)[0].serverTaskId }} |