40 lines
902 B
YAML
40 lines
902 B
YAML
name: Build and Push Backend
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main ]
|
|
paths:
|
|
- 'docker/**'
|
|
- 'play-admin/**'
|
|
- 'play-common/**'
|
|
- 'play-generator/**'
|
|
- 'pom.xml'
|
|
workflow_dispatch: {}
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Ensure buildx is available
|
|
shell: bash
|
|
run: |
|
|
docker buildx version || true
|
|
docker buildx create --use || true
|
|
|
|
- name: Build and push to local registry
|
|
env:
|
|
REGISTRY: 127.0.0.1:5000
|
|
TAG: ${{ github.sha }}
|
|
shell: bash
|
|
run: |
|
|
docker buildx build \
|
|
--platform linux/amd64 \
|
|
-f docker/Dockerfile \
|
|
-t ${REGISTRY}/peipei/backend:${TAG} \
|
|
-t ${REGISTRY}/peipei/backend:latest \
|
|
--push \
|
|
.
|