- Add Gitea Actions workflow for auto-deploy on push to main - Add Dockerfile (nginx:alpine based, with layer caching) - Add nginx.conf (gzip, autoindex, static caching) - Add .dockerignore - Migrate cache.html → cache/index.html for directory-based routing
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: aliyun
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
docker build \
|
||||
--cache-from illustrated-algorithm:latest \
|
||||
-t illustrated-algorithm:latest \
|
||||
.
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user