Run deployment only on releases #158
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: NodeJS | |
on: push | |
env: | |
NEXT_TELEMETRY_DISABLED: 1 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-environment | |
- name: Run build | |
run: npm run build | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/prepare-environment | |
- name: Run eslint | |
run: npm run lint | |
- name: Run prettier | |
run: npm run format:check | |
- name: Run tests | |
run: npm run test | |
- name: Check translations | |
run: npm run i18n:extract && npm run i18n:check | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
needs: | |
- build | |
- test | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |