build: publish latest image when main branch changed

Signed-off-by: Changliang Wu <changliang.wu@smartx.com>
This commit is contained in:
Changliang Wu 2024-11-13 13:33:17 +08:00 committed by zwtop
parent b00c480db9
commit b096f1cee2
1 changed files with 25 additions and 0 deletions

25
.github/workflows/publish.yaml vendored Normal file
View File

@ -0,0 +1,25 @@
name: publish
on:
push:
branches:
- main
env:
cache-registry: 'docker-registry-cache.docker-registry.svc:5000'
jobs:
build:
runs-on: [self-hosted, pod]
steps:
- uses: actions/checkout@v2
- name: Login registry.smtx.io
uses: docker/login-action@v2
with:
registry: registry.smtx.io
username: ${{ secrets.HARBOR_PUSH_USERNAME }}
password: ${{ secrets.HARBOR_PUSH_TOKEN }}
- name: Build and push latest image
run: TAG_SUFFIX=latest docker buildx bake "https://github.com/everoute/actions-runner-controller.git#main"