Merge pull request #197 from bfdes/upgrade-nodejs #410
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: Test & Publish | |
on: push | |
jobs: | |
test: | |
name: Test | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Pull repository | |
uses: actions/checkout@v3 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm test | |
- name: Upload test coverage report | |
uses: codecov/codecov-action@v3 | |
publish: | |
name: Publish | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
deployments: write | |
steps: | |
- name: Pull repository | |
uses: actions/checkout@v3 | |
- name: Set up NodeJS | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install dependencies | |
run: npm ci | |
- name: Build site | |
run: npm run build | |
- name: Publish site | |
uses: cloudflare/pages-action@v1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: blog | |
directory: site | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} |