-
Notifications
You must be signed in to change notification settings - Fork 5
84 lines (68 loc) · 1.88 KB
/
build-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
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
name: Deploy Website
on:
push:
branches:
workflow_dispatch:
permissions:
contents: read
packages: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/atas/ssg-builder:latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# Restore Composer cache (if exists)
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
# Install Composer dependencies
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Generate HTML
run: |
system/bin/generate_html.sh
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: 'html'
path: 'html'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: 'html'
path: './html'
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload entire repository
path: 'html'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2