Skip to content

Commit ed8484c

Browse files
authored
Deploy documentation via GitHub actions (#82)
* feat: Deploy documentation changes via GitHub actions
1 parent 2b06d5b commit ed8484c

File tree

445 files changed

+503
-31088
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

445 files changed

+503
-31088
lines changed

.eleventy.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const redirectCollection = require('./lib/redirectCollection');
1313
module.exports = function (config) {
1414
// Copy folders and files.
1515
config.addPassthroughCopy('build');
16+
config.setUseGitIgnore(false);
1617

1718
// Filters.
1819
config.addFilter('manifest', manifestFilter);
@@ -82,7 +83,9 @@ module.exports = function (config) {
8283
});
8384

8485
site.versions.forEach((version) => {
86+
8587
config.addCollection(version.slug, function (collection) {
88+
8689
return pageCollection(collection, version.glob);
8790
});
8891

.eleventyignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.DS_Store
2+
npm-debug.log*
3+
node_modules/
4+
vendor/
5+
build/
6+
docs/
7+
.vscode/
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Automatically deploy the Timber documentation to GitHub Pages
2+
3+
# 1. Checks out the documentation repository in the /timber-docs directory
4+
# 2. Checks out the timber repository in the /timber directory
5+
# 3. Sets up Node.js
6+
# 4. Sets up PHP 8.2 and Composer
7+
# 5. Builds the static site & builds artifacts
8+
# 6. Deploys artifacts to GitHub Pages
9+
name: Deploy to GitHub Pages
10+
11+
on:
12+
# Runs on pushes targeting the default branch
13+
#push:
14+
# branches: ["master"]
15+
16+
# Allows you to run this workflow manually from the Actions tab
17+
workflow_dispatch:
18+
19+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
20+
permissions:
21+
contents: read
22+
pages: write
23+
id-token: write
24+
25+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
26+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
27+
concurrency:
28+
group: 'pages'
29+
cancel-in-progress: false
30+
31+
jobs:
32+
build:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
path: ./timber-docs
39+
token: ${{ github.token }}
40+
- name: Checkout
41+
uses: actions/checkout@v4
42+
with:
43+
repository: timber/timber
44+
path: ./timber
45+
token: ${{ github.token }}
46+
- name: Setup Nodejs
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 18
50+
- uses: 'shivammathur/setup-php@v2'
51+
with:
52+
php-version: '8.2'
53+
- name: Install composer
54+
uses: ramsey/composer-install@v3
55+
with:
56+
working-directory: 'timber-docs'
57+
- name: Build files
58+
run: |
59+
cd ./timber-docs
60+
npm run build
61+
- name: Setup Pages
62+
uses: actions/configure-pages@v4
63+
- name: Upload artifact
64+
uses: actions/upload-pages-artifact@v3
65+
with:
66+
path: './timber-docs/docs'
67+
# Deployment job
68+
deploy:
69+
needs: build
70+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
71+
permissions:
72+
pages: write # to deploy to Pages
73+
id-token: write # to verify the deployment originates from an appropriate source
74+
environment:
75+
name: github-pages
76+
url: ${{ steps.deployment.outputs.page_url }}
77+
runs-on: ubuntu-latest
78+
steps:
79+
- name: Deploy to GitHub Pages
80+
id: deployment
81+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.DS_Store
22
npm-debug.log*
33
node_modules/
4+
_data/mixManifest.json
45
vendor/
5-
.vscode/
6-
7-
# Never ignore the content/ folder, or this will stop working
8-
# Never ignore the /build/ or the /docs/build/ folder, otherwise they won’t appear on timber.github.io/docs/
6+
build/
7+
content/
8+
docs/
9+
.vscode/

_data/mixManifest.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

build/css/mobile.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

build/css/mobile.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)