chore: upgrade packages #209
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- production | |
pull_request: | |
branches: | |
- master | |
- production | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Run lint | |
run: | | |
npm ci | |
npm run lint | |
typecheck: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Run typecheck | |
run: | | |
npm ci | |
npm run typecheck | |
unit-test: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Run unit test | |
run: | | |
npm ci | |
npm run test | |
dev-deploy: | |
needs: [lint, typecheck, unit-test] | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.event_name == 'push' && github.ref == 'refs/heads/master'" | |
env: | |
VUE_APP_PROTOMAP_API_KEY: e6cfbd46818cf623 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Install and Build | |
run: | | |
npm ci | |
echo "VUE_APP_BASE_URL=https://staging.disfactory.tw/api" > .env | |
echo "VUE_APP_IMGUR_FALLBACK_URL=https://staging.disfactory.tw/imgur" >> .env | |
npm run build | |
- name: Deploy to GitHub Pages | |
uses: JamesIves/[email protected] | |
with: | |
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
BASE_BRANCH: master | |
BRANCH: gh-pages | |
SINGLE_COMMIT: true | |
COMMIT_MESSAGE: Deploy [ci skip] | |
FOLDER: dist | |
production-deploy: | |
needs: [lint, typecheck, unit-test] | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]') && github.event_name == 'push' && github.ref == 'refs/heads/production'" | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.SSH_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- name: Install and Build | |
run: | | |
npm ci | |
echo "VUE_APP_BASE_URL=https://api.disfactory.tw/api" > .env.production | |
echo "VUE_APP_IMGUR_FALLBACK_URL=https://api.disfactory.tw/imgur" >> .env.production | |
npm run build | |
echo "disfactory.tw" > dist/CNAME | |
- name: Deploy to GitHub Pages | |
run: | | |
npm install --silent [email protected] | |
git config user.email "[email protected]" | |
git config user.name "ci-build" | |
npx gh-pages -r "[email protected]:Disfactory/disfactory.tw.git" -m "Deploy [ci skip]" --dist dist |