93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
name: Frontend CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "apps/admin-web/**"
|
|
- "apps/ops-web/**"
|
|
- "packages/**"
|
|
- "Dockerfile.frontend"
|
|
- "Dockerfile.ops-web"
|
|
- ".dockerignore"
|
|
- "deploy/scripts/gitea-registry-images.sh"
|
|
- ".gitea/workflows/frontend-ci.yml"
|
|
- "package.json"
|
|
- "pnpm-lock.yaml"
|
|
- "pnpm-workspace.yaml"
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "apps/admin-web/**"
|
|
- "apps/ops-web/**"
|
|
- "packages/**"
|
|
- "Dockerfile.frontend"
|
|
- "Dockerfile.ops-web"
|
|
- ".dockerignore"
|
|
- "deploy/scripts/gitea-registry-images.sh"
|
|
- ".gitea/workflows/frontend-ci.yml"
|
|
- "package.json"
|
|
- "pnpm-lock.yaml"
|
|
- "pnpm-workspace.yaml"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
frontend:
|
|
name: Frontend
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
|
|
- name: Setup pnpm
|
|
run: |
|
|
corepack enable
|
|
corepack prepare pnpm@10.33.0 --activate
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Typecheck admin web
|
|
run: pnpm typecheck:admin
|
|
|
|
- name: Typecheck ops web
|
|
run: pnpm --filter ops-web typecheck
|
|
|
|
- name: Install Docker CLI
|
|
if: github.event_name != 'pull_request'
|
|
run: |
|
|
if command -v docker >/dev/null 2>&1; then
|
|
docker --version
|
|
exit 0
|
|
fi
|
|
apt-get update
|
|
apt-get install -y docker.io
|
|
|
|
- name: Publish frontend images
|
|
if: github.event_name != 'pull_request'
|
|
env:
|
|
REGISTRY_HOST: 192.168.100.19:13000
|
|
REGISTRY_OWNER: root
|
|
REGISTRY_IMAGE_PREFIX: geo-rankly
|
|
REGISTRY_USERNAME: root
|
|
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
|
|
REGISTRY_PLAIN_HTTP: "true"
|
|
IMAGE_LIST: frontend ops-web
|
|
DELETE_OLD_IMAGE_TAGS: "true"
|
|
KEEP_IMAGE_TAGS: "2"
|
|
run: |
|
|
set -eu
|
|
IMAGE_TAG="$(git rev-parse --short=8 HEAD)"
|
|
export IMAGE_TAG
|
|
bash deploy/scripts/gitea-registry-images.sh ensure
|