init
Some checks are pending
MBTI Static Project Nginx Deploy / build-and-deploy (push) Waiting to run
Some checks are pending
MBTI Static Project Nginx Deploy / build-and-deploy (push) Waiting to run
This commit is contained in:
parent
834966a37d
commit
d23077570f
40
.gitea/workflows/web_build.yaml
Normal file
40
.gitea/workflows/web_build.yaml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
name: MBTI Static Project Nginx Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout MBTI code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
|
- name: Build Nginx image for MBTI
|
||||||
|
uses: docker/build-push-action@v4
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./Dockerfile
|
||||||
|
push: false
|
||||||
|
tags: mbti-nginx:latest
|
||||||
|
|
||||||
|
- name: Stop and remove existing container
|
||||||
|
run: |
|
||||||
|
if docker ps -a --format '{{.Names}}' | grep -q 'mbti-nginx'; then
|
||||||
|
docker stop mbti-nginx
|
||||||
|
docker rm mbti-nginx
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Run MBTI Nginx container
|
||||||
|
run: |
|
||||||
|
docker run -d \
|
||||||
|
--name mbti-nginx \
|
||||||
|
-p 8989:80 \
|
||||||
|
-v /path/to/mbti/static:/usr/share/nginx/html \
|
||||||
|
mbti-nginx:latest
|
Loading…
Reference in New Issue
Block a user