-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.56 KB
/
pages.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#
# Build and Deploy Web Pages
#
# Build the static web-pages and, if required, deploy them to the production
# systems.
#
name: "Web Pages"
on:
pull_request:
push:
branches-ignore: ["pr/**"]
tags: ["**"]
workflow_dispatch:
defaults:
run:
shell: "bash"
jobs:
deploy:
name: "Deploy Web Pages"
container:
image: "ghcr.io/bus1/plumbing:latest"
if: github.event_name == 'workflow_dispatch'
runs-on: "ubuntu-latest"
steps:
- name: "Fetch Sources"
uses: actions/checkout@v3
- name: "Configure rclone"
env:
BUS1EU_SSHKEY_PASSWORD_RCLONE: ${{ secrets.BUS1EU_SSHKEY_PASSWORD_RCLONE }}
BUS1EU_SSHKEY_PRIVATE: ${{ secrets.BUS1EU_SSHKEY_PRIVATE }}
BUS1EU_SSHKEY_USER: ${{ secrets.BUS1EU_SSHKEY_USER }}
run: |
# Store the SSH keys in the file system.
cat <<<"${BUS1EU_SSHKEY_PRIVATE}" >./bus1eu.sshkey
# Create an rclone configuration for each host.
conf=""
conf+="[bus1eu]"$'\n'
conf+="type = sftp"$'\n'
conf+="host = bus1.eu"$'\n'
conf+="user = ${BUS1EU_SSHKEY_USER}"$'\n'
conf+="key_file = $(pwd)/bus1eu.sshkey"$'\n'
conf+="key_file_pass = ${BUS1EU_SSHKEY_PASSWORD_RCLONE}"$'\n'
mkdir -p ~/.config/rclone
touch ~/.config/rclone/rclone.conf
cat <<<"${conf}" >>~/.config/rclone/rclone.conf
- name: "Deploy"
run: |
rclone sync ./lib/bus1.eu bus1eu:public_html/sites/bus1.eu
- name: "Cleanup rclone"
run: |
rm -f "./bus1eu.sshkey"
rm -rf "~/.config/rclone"