Skip to content

Commit 27eb6e2

Browse files
committed
[workflow] Auto build and publish site
1 parent 11fa69d commit 27eb6e2

File tree

3 files changed

+40
-13
lines changed

3 files changed

+40
-13
lines changed

.github/workflows/build-site.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build site and push to gh-pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build site
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Configuring build Environment
17+
run: |
18+
sudo apt-get update
19+
20+
- name: Setup Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: '3.0'
24+
25+
- name: Installing dependencies
26+
run: |
27+
gem install jekyll jekyll-remote-theme jekyll-sass-converter
28+
29+
- name: Build site
30+
run: |
31+
cd site && jekyll b && cd ..
32+
33+
- name: Push to gh-pages branch
34+
if: github.ref == 'refs/heads/main'
35+
run: |
36+
git remote set-url origin https://x-access-token:${{ secrets.MLC_GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
37+
git config --global user.email "mlc-gh-actions-bot@nomail"
38+
git config --global user.name "mlc-gh-actions-bot"
39+
40+
./scripts/gh_deploy_site.sh

scripts/gh_deploy_site.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4-
cd examples/simple-chat
5-
rm -rf lib
6-
npm run build
7-
cd ../..
8-
9-
cp examples/simple-chat/lib/* site
104
cd site && jekyll b && cd ..
115

126
git fetch

site/Gemfile

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

0 commit comments

Comments
 (0)