修改CI
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s Details

This commit is contained in:
AaronHux 2024-05-25 22:50:05 +08:00
parent b6595b8be8
commit d27471e658
2 changed files with 13 additions and 8 deletions

View File

@ -8,11 +8,7 @@ jobs:
steps:
- name: Build & Deploy
run: rm -rf /opt/workspace/website
- run: git clone http://127.0.0.1:3000/huxin/website.git /opt/workspace/website
- run: cd /opt/workspace/website && docker build -t website-v2:latest "."
- run: docker stop website-v2 || true
- run: docker rm -f website-v2 || true
- run: docker run -d -p 9000:80 --restart=unless-stopped --name website-v2 website-v2
- run: docker rmi $(docker images -f "dangling=true" -q) || true
- run: docker ps
- name: Clone Repository
run: git clone http://127.0.0.1:3000/huxin/website.git /opt/workspace/website
- name: Deploy
run: cd /opt/workspace/website && ./deploy.sh

9
deploy.sh Normal file
View File

@ -0,0 +1,9 @@
#!/bin/bash
docker build -t website-v2:latest "."
docker stop website-v2 || true
docker rm -f website-v2 || true
docker run -d -p 9000:80 --restart=unless-stopped --name website-v2 website-v2
docker rmi $(docker images -f "dangling=true" -q) || true
docker ps