Pin dependencies #1579
Workflow file for this run
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| - run: corepack enable | |
| - name: find pnpm cache path | |
| id: cache | |
| run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ${{ steps.cache.outputs.path }} | |
| key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| v1-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - run: node --run lint | |
| fmt: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - uses: biomejs/setup-biome@454fa0d884737805f48d7dc236c1761a0ac3cc13 # v2 | |
| with: | |
| version: latest | |
| - run: biome check | |
| typecheck: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| - run: corepack enable | |
| - name: find pnpm cache path | |
| id: cache | |
| run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ${{ steps.cache.outputs.path }} | |
| key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| v1-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - run: node --run typecheck | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 24 | |
| - run: corepack enable | |
| - name: find pnpm cache path | |
| id: cache | |
| run: echo "path=$(pnpm store path)" >> $GITHUB_OUTPUT | |
| - uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4 | |
| with: | |
| path: ${{ steps.cache.outputs.path }} | |
| key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| v1-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - run: node --run test | |
| env: | |
| NODE_ENV: test | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5 | |
| with: | |
| images: | | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value={{sha}} | |
| type=raw,value=latest | |
| - name: Set up depot | |
| uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1 | |
| - name: Login to GHCR | |
| if: github.ref == 'refs/heads/master' | |
| uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and maybe Push Docker image | |
| uses: depot/build-push-action@2583627a84956d07561420dcc1d0eb1f2af3fac0 # v1 | |
| with: | |
| project: ks849krng9 | |
| push: ${{ github.ref == 'refs/heads/master' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| deploy: | |
| if: github.ref == 'refs/heads/master' | |
| needs: [lint, test, typecheck, build] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: prod | |
| url: https://arm.haglund.dev/api | |
| steps: | |
| - run: echo 'Deployed! :)' |