generated from mandrasch/11ty-plain-bootstrap5
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (57 loc) · 2.06 KB
/
build-deploy.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
name: Build and Deploy
on:
push:
branches:
- main
# Sustainability: Don't trigger build for updated README
paths-ignore:
- "**/README.md"
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Use Node LTS
uses: actions/setup-node@v4
with:
node-version: "16" # lts
cache: 'npm'
# This build runs with path prefix for github pages (hosted on subdirectory),
# for example https://<USER>.github.io/<REPO-NAME>/
# See: https://www.11ty.dev/docs/config/#deploy-to-a-subdirectory-with-a-path-prefix
- name: Install and Build for Github Pages 🔧
run: |
npm install
npm run build
# npm run build -- --pathprefix="${{ github.event.repository.name }}"
# The above doesn't work anymore? :-/
# also doesn't work with eleventy-img https://github.com/11ty/eleventy/issues/1641
# We set pathprefix again via Node env, see below
env:
ELEVENTY_ENV: production
BASE_URL: "https://${{ github.event.repository.owner.name }}.github.io/"
PATH_PREFIX: "/${{ github.event.repository.name }}/"
- name: Deploy to Github Pages 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: _site #the static site folder
# If you need more privacy / no tracking,
# sync your site to your own webspace
# https://github.com/marketplace/actions/ftp-deploy
# Build again if you need another path prefix
# - name: Install and Build for FTP 🔧
# run: |
# npm install
# npm run build
#- name: 📂 Sync files
# uses: SamKirkland/[email protected]
# with:
# server: ftp.samkirkland.com
# username: myFtpUserName
# password: ${{ secrets.ftp_password }}