-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (54 loc) · 1.66 KB
/
create-docs-and-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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