feat: create ci
This commit is contained in:
parent
348a826919
commit
e9a93d8686
31
.gitea/workflows/workflow.yaml
Normal file
31
.gitea/workflows/workflow.yaml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy Static Website
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: Deploy to Web Server
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
with:
|
||||||
|
driver: docker
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
docker buildx build . -t git.mamahaha.work/sangge/hhl -f Dockerfile
|
||||||
|
|
||||||
|
- name: Start Docker
|
||||||
|
run: |
|
||||||
|
docker run -d -p 4010:80 git.mamahaha.work/sangge/hhl
|
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# 使用官方的 Nginx 镜像作为基础镜像
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
# 定义工作目录
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
|
||||||
|
# 移除默认的 Nginx 静态资源
|
||||||
|
RUN rm -rf ./*
|
||||||
|
|
||||||
|
# 将静态网页内容复制到容器中
|
||||||
|
COPY . /usr/share/nginx/html
|
||||||
|
|
||||||
|
# 暴露端口 80
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
# 启动 Nginx 服务
|
||||||
|
CMD ["nginx", "-g", "daemon off;"]
|
Loading…
x
Reference in New Issue
Block a user