Skip to content

Remove vue/composition-api compabilitiy layer; add runtime API base URL configuration modal for testing and development #234

Remove vue/composition-api compabilitiy layer; add runtime API base URL configuration modal for testing and development

Remove vue/composition-api compabilitiy layer; add runtime API base URL configuration modal for testing and development #234

Workflow file for this run

name: CI
on:
push:
branches:
- master
- production
pull_request:
branches:
- master
- production
permissions:
contents: write
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/github-pages-deploy-action@v4
with:
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 gh-pages@3.0
git config user.email "ci-build@disfactory.tw"
git config user.name "ci-build"
npx gh-pages -r "git@github.com:Disfactory/disfactory.tw.git" -m "Deploy [ci skip]" --dist dist