FIXING BUILD ERRORS #3
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: Build and Deploy | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
cache: 'npm' | |
# Framework Build | |
- name: Install Framework Dependencies | |
run: | | |
npm ci | |
npm run clean || true | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
- name: Lint | |
run: npm run lint || echo "Linting skipped" | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
- name: Build Framework | |
run: npm run build | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
# Website Build | |
- name: Install Website Dependencies | |
working-directory: website | |
run: npm ci || echo "No website dependencies to install" | |
- name: Build Website | |
working-directory: website | |
run: npm run build || echo "No website build script" | |
env: | |
NODE_ENV: production | |
- name: Run Tests | |
run: npm test || echo "No tests to run" | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
- name: Deploy Website to GitHub Pages | |
if: github.ref == 'refs/heads/main' | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: website/dist | |
clean: true | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, '[skip-publish]') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.x' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Install Dependencies | |
run: | | |
npm ci | |
npm run clean || true | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
- name: Build | |
run: npm run build | |
env: | |
NODE_OPTIONS: --experimental-vm-modules | |
- name: Publish to NPM | |
if: success() | |
run: | | |
if [ -z "$(npm view velocityfx versions)" ] || [ "$(npm view velocityfx version)" != "$(node -p "require('./package.json').version")" ]; then | |
npm publish | |
else | |
echo "Current version is already published" | |
fi | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_OPTIONS: --experimental-vm-modules |