diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9ca5273..933cde5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -8,6 +8,10 @@ on: permissions: contents: write +concurrency: + group: deploy + cancel-in-progress: false + jobs: deploy: runs-on: ubuntu-latest @@ -15,10 +19,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: 24 @@ -29,7 +33,7 @@ jobs: run: npm run build - name: Deploy to GitHub Pages - uses: JamesIves/github-pages-deploy-action@v4.8.0 + uses: JamesIves/github-pages-deploy-action@v4.9.0 with: branch: gh-pages folder: ./dist diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e0635e..b6a7cdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,9 @@ name: CI -on: [push] +on: + push: + branches: [main] + pull_request: jobs: build-and-test: @@ -8,15 +11,26 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Set up Node.js - uses: actions/setup-node@v6 + uses: actions/setup-node@v7 with: node-version: 24 - name: Install dependencies run: npm install + # Runs before Build, because the prebuild script rewrites formatting. + # A failure shows a warning but does not fail the job. + - name: Check formatting + id: format + continue-on-error: true + run: npm run format:check + + - name: Warn on formatting issues + if: steps.format.outcome == 'failure' + run: echo "::warning title=Formatting::Prettier found unformatted files. Run 'npm run format' and commit the result." + - name: Build run: npm run build