-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (33 loc) · 962 Bytes
/
ci.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
name: CI
on:
push:
branches:
- main
tags: ["*"]
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
ci:
environment: default
runs-on: self-hosted
steps:
- name: Write SSH keys
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
install -m 600 -D /dev/null ~/.ssh/id_key
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_key
host='app'
hosts="$(dig +short "$host" | grep -v '\.$' | sed -z 's|\n|,|g')$host"
ssh-keyscan -H "$hosts" > ~/.ssh/known_hosts
- uses: actions/checkout@v4
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
- name: Deploy website
run: |
ssh app hostname