diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..c59ff5eba --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [dev] + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: "14" + cache: "npm" + + - name: Install Dependencies + run: npm ci + + - name: Test + run: npm run test + + - name: Build + run: npm run build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: . diff --git a/.github/workflows/main.yml b/.github/workflows/test.yml similarity index 54% rename from .github/workflows/main.yml rename to .github/workflows/test.yml index 2a5eac9be..7bd900b5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/test.yml @@ -1,22 +1,11 @@ -# This is a basic workflow to help you get started with Actions - name: CI -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the dev branch - push: - branches: [dev] - pull_request: - branches: [dev] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: +on: [push, pull_request] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build: + test: # The type of runner that the job will run on runs-on: ubuntu-latest @@ -34,12 +23,3 @@ jobs: - name: Test run: npm run test - - - name: Build - run: npm run build - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: .