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