Files
illustrated-algorithm/.gitea/workflows/deploy.yaml
T
2026-08-23 14:30:03 +00:00

39 lines
1023 B
YAML

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: aliyun
steps:
- name: Checkout
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: |
git clone --depth 1 -b main \
https://x-access-token:${GITEA_TOKEN}@47.121.181.112:3000/wonder/illustrated-algorithm.git \
/tmp/illustrated-algorithm
- name: Build Docker Image
run: |
docker build \
--cache-from illustrated-algorithm:latest \
-t illustrated-algorithm:latest \
/tmp/illustrated-algorithm
- name: Deploy Container
run: |
docker stop illustrated-algorithm 2>/dev/null || true
docker rm illustrated-algorithm 2>/dev/null || true
docker run -d \
--name illustrated-algorithm \
--restart unless-stopped \
-p 10000:80 \
illustrated-algorithm:latest
- name: Cleanup Dangling Images
run: docker image prune -f