Node.js CI #86
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: Node.js CI | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 13 * * 1" | |
jobs: | |
build: | |
name: 'Build latest docs and release' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Save date in env | |
run: echo "NOW=$(date +%Y-%m-%d)" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
cache: 'npm' | |
cache-dependency-path: package-lock.json | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- name: Build documentation | |
run: ./run.sh | |
env: | |
CI: true | |
- name: Commit docs | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git checkout master | |
git add docs-gen | |
echo "COMMIT_BEFORE=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
git diff-index --quiet HEAD || git commit -m "Release ${{ env.NOW }}" | |
echo "COMMIT_AFTER=$(git rev-parse HEAD)" >> $GITHUB_ENV | |
git push | |
- name: Create Release | |
if: ${{ env.COMMIT_BEFORE != env.COMMIT_AFTER }} | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ env.NOW }} | |
name: Release ${{ env.NOW }} | |
body: | | |
Changes in this Release | |
- build date ${{ env.NOW }} | |
- based on | |
* https://runtime.fivem.net/doc/natives_cfx.json | |
* https://runtime.fivem.net/doc/natives.json | |
draft: false | |
prerelease: false |