init
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
zhangzhipeng 2025-05-09 11:41:20 +08:00
parent 5bce52dc26
commit 5cd0ad0e34

View File

@ -1,40 +1,13 @@
name: MBTI Static Project Nginx Deploy name: Gitea Actions Demo
run-name: ${{ gitea.actor }} is building run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on: on:
push: push:
branches: branches:
- master - master
jobs: jobs:
build: Explore-Gitea-Actions:
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout MBTI code - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event."
uses: actions/checkout@v3 - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!"
- run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}."
- 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