Skip to content

update github action build steps #4

update github action build steps

update github action build steps #4

Workflow file for this run

name: NodeJS with Webpack
on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Build
run: |
npm install
npx webpack
deploy:
needs: build
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install dependencies and build
run: |
npm install
npx webpack
- name: Deploy to GitHub Pages
id: deployment
uses: JamesIves/github-pages-deploy-action@v4.4.3
with:
branch: gh-pages
folder: dist
token: ${{ secrets.GITHUB_TOKEN }}