Merge pull request #44 from nathanjhood/dependabot/npm_and_yarn/eslin… #229
This file contains 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: node | |
on: | |
# Runs on all pushes | |
push: | |
# # A push is made to a GitHub Pages-enabled branch | |
# page_build: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# When pushing new commits, cancel any running builds on that branch | |
concurrency: | |
group: node-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
PROJECT_NAME: 'esbuild-scripts' | |
PROJECT_VERSION: '0.0.21.${{ github.sha }}' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NODE_ENV: 'production' | |
BUILD_DIR: 'dist' | |
TSC_COMPILE_ON_ERROR: false | |
# fast refresh probably does nothing in prod... | |
FAST_REFRESH: true | |
jobs: | |
run: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
node-version: [20, latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: yarn | |
cache-dependency-path: yarn.lock | |
- name: Environment | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
run: | | |
cp .env.example .env | |
cp .env.example .env.local | |
cp .env.test .env.test.local | |
cp .env.development .env.development.local | |
cp .env.production .env.production.local | |
- name: Install | |
shell: bash | |
working-directory: ${{ github.workspace }} | |
run: yarn | |
- name: Test | |
shell: bash | |
env: | |
NODE_ENV: test | |
working-directory: ${{ github.workspace }} | |
run: yarn test | |
- name: Build | |
shell: bash | |
env: | |
NODE_ENV: production | |
working-directory: ${{ github.workspace }} | |
run: yarn build | |
- name: Start | |
shell: bash | |
env: | |
NODE_ENV: production | |
working-directory: ${{ github.workspace }} | |
run: yarn start build | |
- name: Pack | |
shell: bash | |
env: | |
NODE_ENV: production | |
working-directory: ${{ github.workspace }} | |
run: yarn pack --filename ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}-${{ matrix.os }}-node-${{ matrix.node-version }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}-${{ matrix.os }}-node-${{ matrix.node-version }} | |
path: '${{ github.workspace }}/${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}-${{ matrix.os }}-node-${{ matrix.node-version }}' | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.PROJECT_NAME }}-${{ env.PROJECT_VERSION }}-${{ matrix.os }}-node-${{ matrix.node-version }} | |
path: '${{ github.workspace }}' | |
github-token: ${{ env.GITHUB_TOKEN }} |