From b096f1cee2e52f71aaafb4a800110b6ba17a256e Mon Sep 17 00:00:00 2001 From: Changliang Wu Date: Wed, 13 Nov 2024 13:33:17 +0800 Subject: [PATCH] build: publish latest image when main branch changed Signed-off-by: Changliang Wu --- .github/workflows/publish.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 00000000..52a66245 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -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"