Add MaintenanceModal and warning alert to ImageUploadForm #239
Workflow file for this run
This file contains hidden or 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 | |
| workflow_dispatch: | |
| inputs: | |
| deployment_type: | |
| description: 'Type of deployment to run' | |
| required: false | |
| default: 'production' | |
| type: choice | |
| options: | |
| - production | |
| - staging | |
| permissions: | |
| contents: write | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' || !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: github.event_name == 'workflow_dispatch' || !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: github.event_name == 'workflow_dispatch' || !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: (github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.deployment_type == 'staging') | |
| 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: (github.event_name == 'push' && github.ref == 'refs/heads/production' && !contains(github.event.head_commit.message, '[skip ci]')) || (github.event_name == 'workflow_dispatch' && github.event.inputs.deployment_type == '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 |