Skip to content

Commit c58b47b

Browse files
committed
Initial commit
0 parents  commit c58b47b

79 files changed

Lines changed: 4561 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build and deploy an updated version of the website
2+
3+
on:
4+
[push, pull_request]
5+
6+
env:
7+
MDBOOK_LINKCHECK_VER: 0.7.4
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout gb-asm-tutorial
14+
uses: actions/checkout@v2
15+
with:
16+
path: gb-asm-tutorial
17+
18+
- name: Install mdbook
19+
uses: peaceiris/actions-mdbook@v1
20+
with:
21+
mdbook-version: latest
22+
23+
# FIXME: Keep this up to date
24+
- name: Install mdbook-linkcheck
25+
run: | # `-L` because GitHub performs a redirection
26+
curl -L -o mdbook-linkcheck.zip "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v$MDBOOK_LINKCHECK_VER/mdbook-linkcheck.v$MDBOOK_LINKCHECK_VER.x86_64-unknown-linux-gnu.zip"
27+
unzip mdbook-linkcheck.zip mdbook-linkcheck
28+
chmod +x mdbook-linkcheck
29+
30+
- name: Cache build dir
31+
uses: actions/cache@v2
32+
with:
33+
path: gb-asm-tutorial/target/
34+
key: ${{ runner.os }}-build-${{ hashFiles('gb-asm-tutorial/Cargo.lock') }}
35+
restore-keys: |
36+
${{ runner.os }}-build-
37+
38+
- name: Build
39+
working-directory: gb-asm-tutorial/
40+
env:
41+
MDBOOK_BUILD__CREATE_MISSING: "false" # Prevent creating missing files in SUMMARY.md
42+
MDBOOK_OUTPUT__LINKCHECK__COMMAND: "../mdbook-linkcheck"
43+
MDBOOK_OUTPUT__LINKCHECK__OPTIONAL: "false"
44+
run: |
45+
mdbook build
46+
47+
- name: Store final build
48+
uses: actions/upload-artifact@v2
49+
with:
50+
name: Build output
51+
path: gb-asm-tutorial/book/custom/
52+
if-no-files-found: error
53+
54+
deploy:
55+
runs-on: ubuntu-latest
56+
needs: build
57+
# Do not run this unless *pushing* (`heads`) to `master`
58+
if: github.ref == 'refs/heads/master'
59+
steps:
60+
- name: Checkout gb-asm-tutorial/gh-pages
61+
uses: actions/checkout@v2
62+
with:
63+
path: gb-asm-tutorial
64+
ref: gh-pages
65+
66+
- name: Delete all current files
67+
run: |
68+
rm -vrf gb-asm-tutorial/*
69+
70+
- name: Unpack build
71+
uses: actions/download-artifact@v2
72+
with:
73+
name: Build output
74+
path: gb-asm-tutorial/
75+
76+
- name: Deploy
77+
working-directory: gb-asm-tutorial/
78+
run: |
79+
git config --local user.name "GitHub Action"
80+
git config --global user.email "community@gbdev.io"
81+
git remote -v
82+
git branch -v
83+
git add -A
84+
git commit -am 'Update build'
85+
git push -v

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/book/
2+
/target/

0 commit comments

Comments
 (0)