Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
ltaoo committed Dec 24, 2024
0 parents commit 0b4b934
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI Pipeline

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18" # 根据需要修改 Node.js 版本

- name: Clone and build family-flix/api
run: |
mkdir -p /app/api
git clone https://github.com/family-flix/api /app/api
cd /app/api
npm install
npm run build
- name: Clone and build family-flix/pc2
run: |
mkdir -p /app/pc2
git clone https://github.com/family-flix/pc2 /app/pc2
cd /app/pc2
pnpm install
npm run build
mkdir -p /app/api/dist/dist/assets/pc
mv /app/pc2/dist/* /app/api/dist/dist/assets/pc/
- name: Clone and build family-flix/admin1
run: |
mkdir -p /app/admin1
git clone https://github.com/family-flix/admin1 /app/admin1
cd /app/admin1
pnpm install
npm run build
mkdir -p /app/api/dist/dist/assets/admin
mv /app/admin1/dist/* /app/api/dist/dist/assets/admin/
- name: Clone and build family-flix/mobile1
run: |
mkdir -p /app/mobile1
git clone https://github.com/family-flix/mobile1 /app/mobile1
cd /app/mobile1
pnpm install
npm run build
mkdir -p /app/api/dist/dist/assets/mobile
mv /app/mobile1/dist/* /app/api/dist/dist/assets/mobile/
- name: Build Docker image
run: |
cd /app/api
VERSION=$(jq -r '.version' package.json)
docker build -t ltaoo/family_flix:$VERSION .
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
docker push ltaoo/family_flix:$VERSION
- name: Clean up
run: |
sudo rm -rf /app

0 comments on commit 0b4b934

Please sign in to comment.