generated from PrismarineJS/prismarine-template
-
Notifications
You must be signed in to change notification settings - Fork 153
61 lines (56 loc) · 1.72 KB
/
ci.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
59
60
61
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build
- run: npm test
DeployPages:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout 🛎️
uses: actions/[email protected] # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
fetch-depth: 0
- name: Edit config
run: |
sed -i -E 's/^ "defaultProxy": ""/ "defaultProxy": "pproxy.rom1504.fr"/g' config.json
sed -i -E 's/^ "defaultProxyPort": 0/ "defaultProxyPort": 443/g' config.json
- name: Build
run: |
npm install
npm run build
cp -R public/ ../
rm -Rf ./*
git checkout gh-pages
rm -Rf ./*
rm -Rf .github .gitignore .gitpod .gitpod.DockerFile .npmignore .npmrc
cp -R ../public/* ./
- name: Create commits
run: |
git config user.name 'rom1504bot'
git config user.email '[email protected]'
git add --all
git commit --amend -m "Update gh-pages"
- name: Deploy 🚀
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true