This commit is contained in:
32
.gitea/workflows/deploy.yaml
Normal file
32
.gitea/workflows/deploy.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
name: Deploy Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest # Ensure your runner has this label, or change to 'docker' or similar
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build Docker Image
|
||||||
|
run: |
|
||||||
|
cd web
|
||||||
|
docker build -t my-website:latest .
|
||||||
|
|
||||||
|
- name: Stop and Remove Existing Container
|
||||||
|
run: |
|
||||||
|
docker stop website-container || true
|
||||||
|
docker rm website-container || true
|
||||||
|
|
||||||
|
- name: Run New Container
|
||||||
|
run: |
|
||||||
|
docker run -d \
|
||||||
|
--name website-container \
|
||||||
|
--restart unless-stopped \
|
||||||
|
-p 3000:3000 \
|
||||||
|
my-website:latest
|
||||||
Reference in New Issue
Block a user