Skip to content

Commit

Permalink
[workflow] Auto build and publish site
Browse files Browse the repository at this point in the history
  • Loading branch information
Neet-Nestor committed May 30, 2024
1 parent 11fa69d commit 27eb6e2
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-site.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build site and push to gh-pages

on:
push:
branches:
- main

jobs:
build:
name: Build site
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Configuring build Environment
run: |
sudo apt-get update
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'

- name: Installing dependencies
run: |
gem install jekyll jekyll-remote-theme jekyll-sass-converter
- name: Build site
run: |
cd site && jekyll b && cd ..
- name: Push to gh-pages branch
if: github.ref == 'refs/heads/main'
run: |
git remote set-url origin https://x-access-token:${{ secrets.MLC_GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git config --global user.email "mlc-gh-actions-bot@nomail"
git config --global user.name "mlc-gh-actions-bot"
./scripts/gh_deploy_site.sh
6 changes: 0 additions & 6 deletions scripts/gh_deploy_site.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash
set -euxo pipefail

cd examples/simple-chat
rm -rf lib
npm run build
cd ../..

cp examples/simple-chat/lib/* site
cd site && jekyll b && cd ..

git fetch
Expand Down
7 changes: 0 additions & 7 deletions site/Gemfile

This file was deleted.

0 comments on commit 27eb6e2

Please sign in to comment.