From 5943acab05ee0d19cc81268e3e59ef162ddcd782 Mon Sep 17 00:00:00 2001 From: zach593 Date: Wed, 16 Feb 2022 15:28:05 +0800 Subject: [PATCH] build and upload images when publishing Signed-off-by: zach593 --- .github/workflows/release-image.yml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/release-image.yml diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml new file mode 100644 index 000000000..c5b6f22a8 --- /dev/null +++ b/.github/workflows/release-image.yml @@ -0,0 +1,30 @@ +name: Release Images +on: + release: + types: + - published +jobs: + release-image: + name: release images + # prevent job running from forked repository, otherwise + # 1. running on the forked repository would fail as missing necessary secret. + # 2. running on the forked repository would use unnecessary GitHub Action time. + if: ${{ github.repository == 'karmada-io/karmada' }} + runs-on: ubuntu-18.04 + steps: + - name: checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: install Go + uses: actions/setup-go@v2 + with: + go-version: 1.16.x + - name: build images + env: + REGISTRY: ${{secrets.SWR_REGISTRY}} + REGISTRY_USER_NAME: ${{secrets.SWR_REGISTRY_USER_NAME}} + REGISTRY_PASSWORD: ${{secrets.SWR_REGISTRY_PASSWORD}} + REGISTRY_SERVER_ADDRESS: ${{secrets.SWR_REGISTRY_SERVER_ADDRESS}} + VERSION: ${{ github.ref_name }} + run: make upload-images