Skip to content

增加github actions #6

增加github actions

增加github actions #6

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master"]
tags:
- '*'
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Docker meta syncer
id: meta
uses: docker/metadata-action@v5
with:
images: |
anjia0532/discovery-syncer-python
flavor: |
latest=true
tags: |
type=semver,enable=true,pattern=v{{major}}
type=ref,enable=true,event=tag
type=raw,value=latest,enable={{is_default_branch}}
labels: |
maintainer=AnJia <anjia0532@gmail.com>
org.opencontainers.image.description=从注册中心(如Nacos,Eureka)同步实例信息到网关服务(如Apisix,Kong)
org.opencontainers.image.title=discovery-syncer-python
- name: Docker meta syncer backup
id: meta-backup
uses: docker/metadata-action@v5
with:
images: |
anjia0532/discovery-syncer-python-backup
flavor: |
latest=true
tags: |
type=semver,enable=true,pattern=v{{major}}
type=ref,enable=true,event=tag
type=raw,value=latest,enable={{is_default_branch}}
labels: |
maintainer=AnJia <anjia0532@gmail.com>
org.opencontainers.image.description=从注册中心(如Nacos,Eureka)同步实例信息到网关服务(如Apisix,Kong)
org.opencontainers.image.title=discovery-syncer-python-backup
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.HUB_NAME }}
password: ${{ secrets.HUB_PWD }}
- name: Build discovery-syncer-python image
uses: docker/build-push-action@v6
with:
context: .
file: misc/docker/Dockerfile
push: true
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=anjia0532/discovery-syncer-python:latest
cache-to: type=inline
- name: Build discovery-syncer-python-backup image
uses: docker/build-push-action@v6
with:
context: .
file: misc/docker/BackupDockerfile
push: true
labels: ${{ steps.meta-backup.outputs.labels }}
tags: ${{ steps.meta-backup.outputs.tags }}
cache-from: type=registry,ref=anjia0532/discovery-syncer-python-backup:latest
cache-to: type=inline
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.HUB_NAME }}
password: ${{ secrets.HUB_PWD }}
repository: anjia0532/discovery-syncer-python
readme-filepath: ./README.md
enable-url-completion: true
short-description: ${{ github.event.repository.description }}