-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (37 loc) · 1.08 KB
/
ephemeral_destroy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# SPDX-FileCopyrightText: 2024 The Forkbomb Company
#
# SPDX-License-Identifier: AGPL-3.0-or-later
name: Destroy Ephemeral deployment
on:
pull_request:
types: [closed]
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
permissions:
contents: read # for checkout@v4
jobs:
setup:
runs-on: ubuntu-latest
steps:
- name: Configure 🔒🐚
run: |
mkdir -p ~/.ssh/
echo "$SSH_SKEY" > ~/.ssh/staging.key
chmod 600 ~/.ssh/staging.key
cat >>~/.ssh/config <<END
Host remote
HostName $SSH_HOST
User $SSH_USER
IdentityFile ~/.ssh/staging.key
IdentitiesOnly yes
StrictHostKeyChecking no
Port $SSH_PORT
END
env:
SSH_USER: ${{ secrets.GA_DEPLOY_USER }}
SSH_HOST: ${{ secrets.GA_DEPLOY_HOST }}
SSH_PORT: ${{ secrets.GA_DEPLOY_PORT }}
SSH_SKEY: ${{ secrets.GA_DEPLOY_SK }}
- run: |
ssh remote './ephemeral_destroy.sh ${{ github.event.number }}'