Skip to content

Bump strumwolf/delete-deployment-environment from 2.3.0 to 3.0.0 #12

Bump strumwolf/delete-deployment-environment from 2.3.0 to 3.0.0

Bump strumwolf/delete-deployment-environment from 2.3.0 to 3.0.0 #12

Workflow file for this run

name: 'Remove deployment'
on:
pull_request:
types: [ closed ]
jobs:
cleanup:
name: 'Remove Docker Compose deployment'
runs-on: ubuntu-22.04
if: vars.DEPLOY == 'true'
steps:
- uses: actions/checkout@v4
- name: 'Set variables for PR'
env:
PR: ${{ github.event.pull_request.number }}
PROJECT_NAME: ${{ vars.DEPLOY_PROJECT_NAME }}
run: |
echo "VERSION_TAG=pr-${PR}" >> $GITHUB_ENV
echo "COMPOSE_PROJECT_NAME=${PROJECT_NAME}-pr-${PR}" >> $GITHUB_ENV
- uses: arwynfr/actions-docker-context@v2
with:
docker_host: ${{ secrets.DEPLOY_DOCKER_HOST }}
context_name: 'dev-server'
ssh_cert: ${{ secrets.DEPLOY_DOCKER_HOST_SSH_CERT }}
ssh_key: ${{ secrets.DEPLOY_DOCKER_HOST_SSH_KEY }}
use_context: true
- name: 'Add known hosts'
run: |
DEPLOY_DOCKER_HOST=${{ secrets.DEPLOY_DOCKER_HOST }}
ssh-keyscan -H ${DEPLOY_DOCKER_HOST##*@} > $HOME/.ssh/known_hosts
- uses: actions/checkout@v4
with:
repository: B3Partners/tailormap-viewer
path: tailormap-viewer
sparse-checkout: |
docker-compose*.yml
sparse-checkout-cone-mode: false
- name: 'Remove pull request deployment and image'
env:
COMPOSE_FILE: docker-compose.yml:docker-compose.traefik.yml:ci/docker-compose.pr.yml
VERSION: ${{ env.VERSION_TAG }}
TAILORMAP_IMAGE: ${{ vars.DEPLOY_IMAGE_TAG }}
run: |
cd tailormap-viewer
docker compose config
docker compose down --rmi all --volumes --remove-orphans
- name: 'GitHub Slug Action'
uses: rlespinasse/github-slug-action@v4
- name: 'Remove GitHub deployment and environment'
if: ${{ always() }}
uses: strumwolf/[email protected]
with:
token: "${{ secrets.GITHUB_TOKEN }}"
environment: test
onlyRemoveDeployments: true
ref: "${{ env.GITHUB_HEAD_REF }}"