diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..f98fd61 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,24 @@ +name: Lint code + +on: + workflow_call: + push: + paths: [next] + +defaults: + run: + working-directory: next + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Install dependencies + run: make pnpm install + - name: Format and lint + run: make lint \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..fea86ae --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,59 @@ +name: Deploy to GitHub Pages +on: + pull_request: + types: [closed] + paths: [next] + branches: [main] + +defaults: + run: + working-directory: next + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + check: + uses: ./.github/workflows/check.yml + build: + if: github.event.pull_request.merged == true + needs: [check] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Setup GitHuib Pages + uses: actions/configure-pages@v5 + with: + static_site_generator: next + - name: Install dependencies + run: make pnpm install + + - name: Build with Next.js + run: pnpm build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./out + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: build + + steps: + - name: Publish to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/next/Makefile b/next/Makefile index eff63e4..f4d361c 100644 --- a/next/Makefile +++ b/next/Makefile @@ -7,7 +7,7 @@ install: format: pnpm format -lint: format +lint: pnpm lint local: