-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (39 loc) · 1.34 KB
/
build.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
name: Build
on:
- push
permissions:
contents: write
jobs:
Build:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Checkout
uses: actions/checkout@v4
- name: Prepare Filesystem
run: |
mkdir -p ./.build
- name: Create Butane YAML with Terraform
run: |
pushd ./terraform
echo "Initialising Terraform..."
terraform init
echo "Applying Terraform..."
terraform apply -auto-approve
echo "Starting index page..."
echo "<html><head><title>Butane</title><body><h1>Butane</h1><p>Deployed by Terraform</p><ul>" > ../.build/index.html
echo "Getting Terraform JSON outputs..."
for i in "plex" "swarm_manager" "swarm_worker" "k3s"; do
echo " ... ${i}"
terraform output -raw ${i} > ../.build/${i}.json
echo "<li><a href=\"${i}.json\">${i}</a></li>" >> ../.build/index.html
done
echo "Closing index page..."
echo "</ul></body></html>" >> ../.build/index.html
popd
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: .build