Merge pull request #44 from pkolt/31-add-translates #73
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: Main Workflow | |
on: | |
# Runs on pushes targeting the default branch | |
push: | |
branches: | |
- '*' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
env: | |
node_version: '22' | |
jobs: | |
install: | |
name: Install dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ✅ | |
uses: actions/checkout@v4 | |
- name: Setup Node 🤖 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
cache: npm | |
- name: Cache node_modules 🔮 | |
id: cache-modules | |
uses: actions/cache@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies 📦 | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
shell: bash | |
run: npm ci | |
linters: | |
name: Run Linters | |
needs: [install] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ✅ | |
uses: actions/checkout@v4 | |
- name: Setup Node 🤖 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
cache: npm | |
- name: Restore cache 🔮 | |
id: cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Check Linters 🕵️♂️ | |
run: node --run lint-all | |
typescript: | |
name: Check TypeScript | |
needs: [install] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ✅ | |
uses: actions/checkout@v4 | |
- name: Setup Node 🤖 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
cache: npm | |
- name: Restore cache 🔮 | |
id: cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Check TypeScript 👷♂️ | |
run: node --run check-ts | |
test: | |
name: Run Tests | |
needs: [install] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ✅ | |
uses: actions/checkout@v4 | |
- name: Setup Node 🤖 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
cache: npm | |
- name: Restore cache 🔮 | |
id: cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Run Tests 🚦 | |
run: node --run test | |
- name: Run Benchmark | |
run: node --run bench | |
build: | |
name: Build site | |
needs: [install] | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout ✅ | |
uses: actions/checkout@v4 | |
- name: Setup Node 🤖 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
cache: npm | |
- name: Restore cache 🔮 | |
id: cache | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }} | |
- name: Build site 🔥 | |
run: node --run build | |
- name: Upload artifact 📀 | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
deploy: | |
name: Deploy site | |
# Add a dependency to the build job | |
needs: [build] | |
if: github.ref == 'refs/heads/master' | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |