Repository navigation
Merge pull request #659 from inkonchain/chore/upgrade-nextra-3 #1514
This file contains hidden or 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: CI/CD Workflow | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| securesdlc: | |
| uses: inkonchain/.github/.github/workflows/securesdlc.yml@main | |
| secrets: inherit | |
| install_modules: | |
| needs: securesdlc | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: volta-cli/action@v4 | |
| - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 | |
| with: | |
| run_install: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22.x" | |
| cache: "pnpm" | |
| - name: Add pnpm store path to env var | |
| id: pnpm-cache | |
| shell: bash | |
| run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| # Restore the cache BEFORE installing: restoring afterwards can extract a | |
| # stale node_modules (via restore-keys) on top of a fresh install and then | |
| # save that poisoned state under the new lockfile's cache key. | |
| - name: Cache node modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| **/node_modules | |
| key: ${{ runner.os }}-pnpm-store-v2-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store-v2- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| js-lint: | |
| needs: install_modules | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/base-setup | |
| name: Base Setup | |
| - name: JS linting | |
| run: pnpm run lint:js | |
| md-lint: | |
| needs: install_modules | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/base-setup | |
| name: Base Setup | |
| - name: MDX linting | |
| run: pnpm run lint:mdx | |
| format: | |
| needs: install_modules | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/base-setup | |
| name: Base Setup | |
| - name: Run formatting | |
| run: pnpm run format:js | |
| # spell-check: | |
| # needs: install_modules | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # - uses: ./.github/actions/base-setup | |
| # name: Base Setup | |
| # - name: Run Spellcheck | |
| # run: pnpm run spellcheck:lint | |
| build: | |
| needs: install_modules | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/base-setup | |
| name: Base Setup | |
| - name: Building app | |
| run: pnpm run build | |
| - name: Cache build | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: .next | |
| key: ${{ runner.os }}-build-store-${{ hashFiles('.next') }} | |
| docker-publish: | |
| if: github.ref == 'refs/heads/main' | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v2 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: ghcr.io/inkonchain/docs:latest | |
| - name: Log out from GitHub Container Registry | |
| run: docker logout ghcr.io |