- Rename docker workflow files for clarity: 'docker-dev' and 'docker-main' - Remove unused city seed files to streamline the database seeding process These changes improve the organization of the workflow files and reduce clutter in the seed data, making it easier to manage and maintain the project.
48 lines
1.3 KiB
YAML
48 lines
1.3 KiB
YAML
name: Docker Dev
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
env:
|
|
# Use docker.io for Docker Hub if empty
|
|
REGISTRY: docker.io
|
|
IMAGE_NAME: ${{ github.event.repository.name }}
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # 获取完整的 git history 以便生成正确的 tag
|
|
-
|
|
name: Get Version
|
|
id: get_version
|
|
run: |
|
|
echo "VERSION=$(git describe --dirty --always --tags --abbrev=7)" >> $GITHUB_OUTPUT
|
|
-
|
|
name: Login to ${{ env.REGISTRY }}
|
|
if: github.event_name != 'pull_request'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{github.actor}}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
-
|
|
name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
-
|
|
name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
tags: |
|
|
${{ env.REGISTRY }}/${{github.actor}}/${{ github.event.repository.name }}_dev:dev |