-
Notifications
You must be signed in to change notification settings - Fork 8
59 lines (52 loc) · 1.5 KB
/
build_and_deploy.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
name: Build and deploy HUGO website
on:
# Runs on pull requests to check that the website is building without errors
pull_request:
# Runs on push/merge to main to deploy the new website
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
# Checkout repo AND ITS SUBMODULES
- name: 🛒 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
# Build the static website with the provided docker-compose rules
- name: 🛠️ Build with HUGO
run: |
docker compose up builder
# Upload build artifacts for deployment or download
- name: 🚀 Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build
path: ./build/blog
deploy:
needs: [build]
# if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- name: 🛠️ Setup build directory
run: |
mkdir -p build/blog
- name: 📥 Download build Artifacts
uses: actions/download-artifact@v3
with:
name: build
path: build/blog
- name: 🔐 Create Key File
run: |
touch ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
- name: 🔑 Populate Key
run: echo "${{ secrets.PRIVATE_SSH_KEY }}" > ~/.ssh/id_rsa
- run: |
tree
ll ~/.ssh
cat ~/.ssh/id_rsa