prismarine-web-client-mirror/.github/workflows/ci.yml

63 lines
1.8 KiB
YAML
Raw Normal View History

2021-02-27 16:27:59 -05:00
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.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
2021-03-03 22:00:10 -05:00
- run: npm test
DeployPages:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2.3.1 # 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
2021-03-12 11:02:17 -05:00
fetch-depth: 0
2021-03-03 22:00:10 -05:00
- name: Edit config
2021-03-14 12:25:15 -04:00
run: |
2021-03-14 12:19:23 -04:00
sed -i -E 's/^ "defaultProxy": ""/ "defaultProxy": "pproxy.rom1504.fr"/g' config.json
2021-03-14 12:31:05 -04:00
sed -i -E 's/^ "defaultProxyPort": 0/ "defaultProxyPort": 443/g' config.json
2021-03-03 22:00:10 -05:00
- name: Build
run: |
npm install
npm run build
2021-03-03 22:00:10 -05:00
cp -R public/ ../
2021-03-12 11:09:49 -05:00
rm -Rf ./*
2021-03-12 10:59:16 -05:00
git checkout gh-pages
2021-03-12 10:44:42 -05:00
cp CNAME ../public/
2021-03-03 22:00:10 -05:00
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 'rom1504bot@users.noreply.github.com'
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
2021-03-12 10:44:42 -05:00
force: true