deploy-nightly #446
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-nightly | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '00 2 * * *' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v1.4.4 | |
with: | |
# Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0 | |
node-version: 16.x | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Detect changes | |
if: github.event_name == 'schedule' | |
id: detect_changes | |
run: | | |
echo "name=changes::$(git log --since="24 hours ago")" >> $GITHUB_OUTPUT | |
- name: Setup Python dependencies | |
if: github.event_name != 'schedule' || steps.detect_changes.outputs.changes != '' | |
run: | | |
pip3 install mkdocs | |
pip3 install mkdocs-material | |
pip3 install mkdocs-localsearch | |
- name: Build | |
if: github.event_name != 'schedule' || steps.detect_changes.outputs.changes != '' | |
run: | | |
npm install grunt-cli -g | |
npm install . | |
grunt | |
- name: Get Date | |
id: date | |
if: github.event_name != 'schedule' || steps.detect_changes.outputs.changes != '' | |
run: echo "date=$(date +'%D')" >> $GITHUB_OUTPUT | |
- name: Deploy | |
if: github.event_name != 'schedule' || steps.detect_changes.outputs.changes != '' | |
uses: JamesIves/github-pages-deploy-action@4.1.1 | |
with: | |
repository-name: ChoiceScriptIDE/web | |
branch: gh-pages | |
folder: build | |
target-folder: nightly | |
git-config-name: 'CSIDE-Shell' | |
git-config-email: '32689095+CSIDE-Shell@users.noreply.github.com' | |
commit-message: 'Nightly deployment (${{ steps.date.outputs.date }})' | |
token: ${{ secrets.CSIDESHELL }} |