-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (48 loc) · 1.19 KB
/
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
# SPDX-FileCopyrightText: 2020 the Booster Authors
#
# SPDX-License-Identifier: MIT
name: Release
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.14.1
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: npm install, build
run: |
npm ci
npm run build
- name: add build to stash
run: |
rm -rf node_modules
git stash --all
- name: move to gh-pages
run: |
git checkout gh-pages
rm -rf $( ls | grep -v CNAME )
git stash pop
mv build/* .
rm -r build
- name: Add changes
run: |
git config --local user.name $GITHUB_ACTOR
git add -A
git commit -m "Release $VERSION"
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages