Skip to content

👷 ワークフローを微修正 #289

👷 ワークフローを微修正

👷 ワークフローを微修正 #289

name: Test run and Deploy to dist branch
on:
push:
branches-ignore:
- dist
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-run-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout dist branch
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/checkout@v3
with:
ref: dist
path: ./dist
- name: Cache Node dependencies
uses: actions/cache@v3
with:
path: ./node_modules
key: ${{ runner.os }}-node-deps-${{ hashFiles('./yarn.lock') }}
- name: Cache SBT dependencies
uses: actions/cache@v3
with:
path: |
~/.sbt
~/.ivy2/cache
~/.ivy2/local/org.scalablytyped
./target/scala-*/scalajs-bundler/node_modules
key: ${{ runner.os }}-sbt-deps-${{ hashFiles('./build.sbt') }}
- name: Install Node dependencies
run: yarn install
- name: Build for production
run: yarn build
- name: Export environments
uses: peaceiris/[email protected]
id: envs
- name: Run
run: yarn test-run
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.envs.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_CACHE_URL: ${{ steps.envs.outputs.ACTIONS_CACHE_URL }}
- name: Pre deploy
if: ${{ github.ref == 'refs/heads/main' }}
run: cp action.yml LICENSE README.md .gitignore dist
- name: Deploy to dist
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: dist
directory: ./dist
empty: true
message: Compiled from ${{ github.SHA }}