From c05f0e36969307df3dc4ba942d37b350b1c3c986 Mon Sep 17 00:00:00 2001 From: zhangye151 <92865459+zhangye151@users.noreply.github.com> Date: Thu, 22 May 2025 23:50:03 +0800 Subject: [PATCH] Create docker.yml --- .github/workflows/docker.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..1a1f446b --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,30 @@ +name: Build and Push Docker Images + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and Push API + run: | + docker build -t zhangye151/httpsms-api:latest ./api + docker push zhangye151/httpsms-api:latest + + - name: Build and Push Web + run: | + docker build -t zhangye151/httpsms-web:latest ./web + docker push zhangye151/httpsms-web:latest