Merge pull request #1365 from zach593/feature-ci-add-image-builds-when-publishing

build and upload images when publishing
This commit is contained in:
karmada-bot 2022-02-16 16:43:55 +08:00 committed by GitHub
commit cd80e2f3c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 30 additions and 0 deletions

30
.github/workflows/release-image.yml vendored Normal file
View File

@ -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