Skip to content

Fixed live demo build script #30

Fixed live demo build script

Fixed live demo build script #30

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Update Live Demo
on:
push:
branches: [ "main" ]
paths:
- "src/**"
- "www/**"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout @mehmetb/tga-for-web
with:
path: 'tga-for-web'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 20.x
- run: |
cd ./tga-for-web
yarn install
yarn build-live-demo
name: Create JS bundle
- uses: actions/checkout@v3
name: Checkout @mehmetb/mehmetb.github.io
with:
repository: mehmetb/mehmetb.github.io
path: 'mehmetb.github.io'
token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
- name: Commit changes to @mehmetb/mehmetb.github.io (if any)
run: |
cd ./tga-for-web
cp -r www/* ../mehmetb.github.io/tga-for-web-live-demo/
cd ../mehmetb.github.io
if [[ -z $(git status -s) ]]; then
echo "noting to commit";
else
git config user.name github-actions
git config user.email github-actions@github.com
git add .
git commit -m "Updated live demo of 'tga-for-web'"
git push
fi