Skip to content

Commit

Permalink
Create main1.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
reed-tom authored May 10, 2024
1 parent 2c306bc commit b19868e
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/main1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
lint-test-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node & NPM
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'

- name: Install
run: npm ci

- name: Lint
run: npm run lint

- name: Typecheck
run: npm run typecheck

- name: Check formatting
run: npm run format:check

- name: Unit tests
run: npm run test:unit

- name: Rendering tests
run: npm run test:rendering

- name: Build demo
run: npm run build:demo

- run: echo "::set-env name=BRANCH_NAME::${GITHUB_HEAD_REF:-main}"

# Check for write permission
- name: Check user permission
id: check-write-access
uses: scherermichael-oss/action-has-permission@master
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Only if user has write permission
- name: Deploy
if: steps.check-write-access.outputs.has-permission
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./demo/dist
destination_dir: ${{env.BRANCH_NAME}}
keep_files: true
exclude_assets: '*.js.map'

0 comments on commit b19868e

Please sign in to comment.