Skip to content

Start Site

Start Site #25

Workflow file for this run

name: Start Site
on:
workflow_dispatch:
inputs:
branch:
description: "Branch of Xcratch"
default: "xcratch-dev"
required: true
dev:
description: "Publish for development"
type: boolean
default: true
required: true
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- name: Inputs
run: echo "${{ toJSON(inputs) }}"
- name: checkout scratch-gui
uses: actions/checkout@v3
with:
repository: xcratch/scratch-gui
ref: ${{ inputs.branch }}
path: ./scratch-gui
- run: npm install
working-directory: ./scratch-gui
- name: checkout xcratch.github.io
uses: actions/checkout@v3
with:
repository: xcratch/xcratch.github.io
path: ./xcratch.github.io
- run: node ./scripts/replace-logo.js ../scratch-gui
working-directory: ./xcratch.github.io
- run: node ./scripts/original-assets.js ../scratch-gui
working-directory: ./xcratch.github.io
- name: build scratch-gui
run: npm run build
working-directory: ./scratch-gui
- run: cp ./xcratch.github.io/editor/favicon.ico ./scratch-gui/build/static/favicon.ico
- run: mv -T ./xcratch.github.io/public ./public
- run: mv -T ./scratch-gui/build ./public/editor
- name: checkout xcratch-doc
uses: actions/checkout@v3
with:
repository: xcratch/xcratch-doc
path: ./xcratch-doc
- run: mv -T ./xcratch-doc/docs ./public/docs
- name: publish for dev
if: ${{ inputs.dev }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: ./dev
keep_files: false
- name: publish
if: ${{ !inputs.dev }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
destination_dir: .
keep_files: true