diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..16e702c --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,40 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>hatena/renovate-config", + ":automergePatch", + ":disableRateLimiting" + ], + "schedule": ["before 8am on Saturday"], + "labels": ["dependencies"], + "platformAutomerge": true, + "separateMultipleMajor": true, + "lockFileMaintenance": { + "enabled": true + }, + "commitMessagePrefix": "chore: ", + "packageRules": [ + { + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "automerge": true + }, + { + "matchDepTypes": ["devDependencies"], + "automerge": true + }, + { + "groupName": "linters", + "extends": ["packages:linters"], + "matchPackagePatterns": ["^@typescript-eslint/", "prettier", "stylelint"], + "automerge": true, + "major": { "automerge": false } + }, + { + "groupName": "storybook", + "extends": ["monorepo:storybook"], + "matchPackagePatterns": ["^@storybook/", "^storybook-"], + "automerge": true, + "major": { "automerge": false } + } + ] +} diff --git a/.github/workflows/_ci.yml b/.github/workflows/_ci.yml new file mode 100644 index 0000000..6e7a5e8 --- /dev/null +++ b/.github/workflows/_ci.yml @@ -0,0 +1,34 @@ +on: workflow_call + +jobs: + setup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - uses: actions/cache@v3 + id: yarn-cache + with: + path: | + ${{ github.workspace }}/node_modules + ${{ github.workspace }}/.yarn/cache + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules + - name: Install packages + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --immutable + + check: + runs-on: ubuntu-latest + needs: setup + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ${{ github.workspace }}/node_modules + ${{ github.workspace }}/.yarn/cache + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules + - name: tsc/lint/format check + run: yarn tsc && yarn run biome ci . diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8161a22 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: check + +on: + push: + branches: "!main" + +jobs: + ci: + uses: ./.github/workflows/_ci.yml + + build: + runs-on: ubuntu-latest + needs: ci + steps: + - uses: actions/checkout@v3 + - uses: actions/cache@v3 + with: + path: | + ${{ github.workspace }}/node_modules + ${{ github.workspace }}/.yarn/cache + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules + - uses: actions/cache@v3 + id: build-cache + with: + path: ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-next-build-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-next-build- + - name: Run build + if: steps.build-cache.outputs.cache-hit != 'true' + run: yarn turbo build + env: + NODE_ENV: development + NEXT_PUBLIC_AIRTABLE_API_KEY: ${{ vars.NEXT_PUBLIC_AIRTABLE_API_KEY }} + NEXT_PUBLIC_AIRTABLE_BASE_INQUIRYFORM: ${{ vars.NEXT_PUBLIC_AIRTABLE_BASE_INQUIRYFORM }} + NEXT_PUBLIC_AIRTABLE_TABLE_INQUIRYFORM: ${{ vars.NEXT_PUBLIC_AIRTABLE_TABLE_INQUIRYFORM }} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..90dbbf6 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,57 @@ +name: Deploy site + +on: + push: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + ci: + uses: ./.github/workflows/_ci.yml + + build: + runs-on: ubuntu-latest + needs: ci + steps: + - uses: actions/checkout@v3 + - uses: actions/configure-pages@v3 + with: + static_site_generator: next + - uses: actions/cache@v3 + with: + path: | + ${{ github.workspace }}/node_modules + ${{ github.workspace }}/.yarn/cache + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-nodemodules + - name: build + run: yarn build-static + env: + NODE_ENV: production + NEXT_PUBLIC_AIRTABLE_API_KEY: ${{ vars.NEXT_PUBLIC_AIRTABLE_API_KEY }} + NEXT_PUBLIC_AIRTABLE_BASE_INQUIRYFORM: ${{ vars.NEXT_PUBLIC_AIRTABLE_BASE_INQUIRYFORM }} + NEXT_PUBLIC_AIRTABLE_TABLE_INQUIRYFORM: ${{ vars.NEXT_PUBLIC_AIRTABLE_TABLE_INQUIRYFORM }} + + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./out + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2