-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (33 loc) · 950 Bytes
/
publish.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
name: publish
on:
push:
branches: [ main ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with: {node-version: 14.x}
- uses: actions/cache@v2
with:
path: |
~/.yarn
node_modules
key: ${{runner.os}}-node-${{hashFiles('**/yarn.lock')}}
restore-keys: ${{runner.os}}-node-14
- run: "git fetch --all"
- run: "git switch hostme"
- run: "git reset main --hard"
- run: "npm install yarn --global"
- run: "yarn"
- run: "yarn build:prod"
- run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git config --global user.name "${{ github.actor }}"
- run: "ls | grep -v dist | grep -v CNAME | xargs rm -r"
- run: "mv dist/** ."
- run: "rm -r dist"
- run: "git add -A"
- run: "git commit -m 'publish'"
- run: "git push -f"