Add rule to convert require (#107) #96
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: Site | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-site: | |
name: Build darklua site | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: site | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: "npm" | |
cache-dependency-path: "site/package-lock.json" | |
- name: Install dependencies | |
run: npm install --legacy-peer-deps | |
- name: Verify code style | |
run: npm run style-check | |
- uses: jetli/wasm-pack-action@v0.4.0 | |
with: | |
version: "latest" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
site/darklua-wasm/target/ | |
key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }} | |
- name: Build darklua-wasm for Node | |
run: wasm-pack build darklua-wasm -t nodejs -d pkg | |
- name: Install JavaScript wasm tests dependencies | |
working-directory: site/darklua-wasm/javascript-tests | |
run: npm install | |
- name: Run JavaScript wasm tests dependencies | |
working-directory: site/darklua-wasm/javascript-tests | |
run: npm run test | |
- name: Build darklua-wasm (release) | |
run: | | |
mv darklua-wasm/pkg darklua-wasm/node-pkg | |
wasm-pack build darklua-wasm -t bundler --release | |
- uses: actions/cache@v3 | |
if: github.ref != 'refs/heads/main' | |
with: | |
path: | | |
site/public/ | |
site/.cache/ | |
key: ${{ runner.os }}-gatsby-build-${{ hashFiles('site/package-lock.json') }} | |
- name: Build site | |
run: | | |
npx gatsby --version | |
npx gatsby build | |
- name: Archive site | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: site/public | |
deploy: | |
name: Deploy darklua site | |
runs-on: ubuntu-latest | |
needs: build-site | |
if: github.ref == 'refs/heads/main' | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: Deploy site to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |