Fix workflow: change branch from main to master

This commit is contained in:
537yaha
2026-01-04 20:51:57 +08:00
parent c95acfab33
commit 915c758873
+42 -5
View File
@@ -2,15 +2,52 @@ name: Build and Push Docker Image
on:
push:
branches: [ master,main ]
branches: [ master, main ]
workflow_dispatch:
jobs:
build:
build-backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and push
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: 537yaha/ai-cs:latest
tags: 537yaha/ai-cs-backend:latest
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push frontend
uses: docker/build-push-action@v4
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: 537yaha/ai-cs-frontend:latest