Skip to content

Update dependencies in package.json and Dockerfile, and update GitHub… #39

Update dependencies in package.json and Dockerfile, and update GitHub…

Update dependencies in package.json and Dockerfile, and update GitHub… #39

Workflow file for this run

name: CI
on:
push:
branches: [main]
env:
GRAPHQL_API_URL: https://api.tsinghua.app
GRAPHQL_ADMIN_SECRET: ${{ secrets.GRAPHQL_ADMIN_SECRET }}
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: pnpm/action-setup@v3
with:
version: 9
- id: get-store-path
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.next/cache
key: nextjs-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
nextjs-
nextjs-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install
run: pnpm install --frozen-lockfile
- name: Codegen
run: pnpm codegen
- name: Lint
run: pnpm lint
- name: Type Check
run: pnpm typecheck
- name: Build
run: pnpm build
deploy:
needs: [check]
runs-on: ubuntu-latest
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONTAINER_NAME: thursday
steps:
- uses: actions/checkout@v4
- name: Login into registry
run: echo $GITHUB_TOKEN | docker login ghcr.io -u $USERNAME --password-stdin
- name: Build Docker image
run: docker build --build-arg GRAPHQL_API_URL=$GRAPHQL_API_URL --build-arg GRAPHQL_ADMIN_SECRET=$GRAPHQL_ADMIN_SECRET -t ghcr.io/${{ github.repository }}/$CONTAINER_NAME:latest .
- name: Push to registry
run: docker push ghcr.io/${{ github.repository }}/$CONTAINER_NAME:latest