-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (119 loc) · 4.94 KB
/
Documentation Deployment.yaml
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Documentation Deployment.yaml
#
# This source file is part of the SDGSwift open source project.
# https://sdggiesbrecht.github.io/SDGSwift
#
# Copyright ©2021–2024 Jeremy David Giesbrecht and the SDGSwift project contributors.
#
# Soli Deo gloria.
#
# Licensed under the Apache Licence, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for licence information.
name: Documentation Deployment
on:
push:
branches:
- master
jobs:
Deployment:
name: Deployment
runs-on: ubuntu-20.04
container: swift:5.8.0-focal
steps:
- name: Check out
uses: actions/checkout@v3
- name: Cache Workspace
uses: actions/cache@v3
with:
key: Ubuntu‐${{ hashFiles('.github/workflows/**') }}
path: .build/SDG/Workspace
- name: Repair Git
shell: bash
run: |
set -x
git config --global --add safe.directory '*'
- name: Install SwiftPM dependencies
shell: bash
run: |
set -x
apt-get update --assume-yes
UCF_FORCE_CONFOLD=1 DEBIAN_FRONTEND=noninteractive \
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
install --assume-yes \
libncurses-dev \
libsqlite3-dev
- name: Install Workspace dependencies
shell: bash
run: |
set -x
apt-get update --assume-yes
UCF_FORCE_CONFOLD=1 DEBIAN_FRONTEND=noninteractive \
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \
install --assume-yes \
curl
- name: Install Workspace
shell: bash
run: |
set -x
if workspace version > /dev/null 2>&1 ; then
echo "Using system install of Workspace..."
workspace version •language '🇨🇦EN' •use‐version 0.44.1
elif .build/SDG/Workspace/workspace version > /dev/null 2>&1 ; then
echo "Using repository cache of Workspace..."
.build/SDG/Workspace/workspace version •language '🇨🇦EN' •use‐version 0.44.1
else
echo "No cached build detected; fetching Workspace..."
export OVERRIDE_INSTALLATION_DIRECTORY=.build/SDG
curl -sL https://gist.github.com/SDGGiesbrecht/4d76ad2f2b9c7bf9072ca1da9815d7e2/raw/update.sh | bash -s Workspace "https://github.com/SDGGiesbrecht/Workspace" 0.44.1 "" workspace
.build/SDG/Workspace/workspace version •language '🇨🇦EN' •use‐version 0.44.1
fi
- name: Refresh
shell: bash
run: |
set -x
if workspace version > /dev/null 2>&1 ; then
echo "Using system install of Workspace..."
workspace refresh •language '🇨🇦EN' •use‐version 0.44.1
elif .build/SDG/Workspace/workspace version > /dev/null 2>&1 ; then
echo "Using repository cache of Workspace..."
.build/SDG/Workspace/workspace refresh •language '🇨🇦EN' •use‐version 0.44.1
else
echo "No cached build detected; fetching Workspace..."
export OVERRIDE_INSTALLATION_DIRECTORY=.build/SDG
curl -sL https://gist.github.com/SDGGiesbrecht/4d76ad2f2b9c7bf9072ca1da9815d7e2/raw/update.sh | bash -s Workspace "https://github.com/SDGGiesbrecht/Workspace" 0.44.1 "" workspace
.build/SDG/Workspace/workspace refresh •language '🇨🇦EN' •use‐version 0.44.1
fi
- name: Document
shell: bash
run: |
set -x
if workspace version > /dev/null 2>&1 ; then
echo "Using system install of Workspace..."
workspace validate •job deployment •language '🇨🇦EN' •use‐version 0.44.1
elif .build/SDG/Workspace/workspace version > /dev/null 2>&1 ; then
echo "Using repository cache of Workspace..."
.build/SDG/Workspace/workspace validate •job deployment •language '🇨🇦EN' •use‐version 0.44.1
else
echo "No cached build detected; fetching Workspace..."
export OVERRIDE_INSTALLATION_DIRECTORY=.build/SDG
curl -sL https://gist.github.com/SDGGiesbrecht/4d76ad2f2b9c7bf9072ca1da9815d7e2/raw/update.sh | bash -s Workspace "https://github.com/SDGGiesbrecht/Workspace" 0.44.1 "" workspace
.build/SDG/Workspace/workspace validate •job deployment •language '🇨🇦EN' •use‐version 0.44.1
fi
- name: Grant permission to cache
shell: bash
run: |
set -x
chmod -R a+rwx .
- name: Deploy
shell: bash
run: |
set -x
cd docs
git init
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add .
git commit -m "Generated documentation for ${GITHUB_SHA}."
git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git master:gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}