Update workflows to release images to dockerhub

Signed-off-by: RainbowMango <qdurenhongcai@gmail.com>
This commit is contained in:
RainbowMango 2022-03-21 15:37:43 +08:00
parent 1c2dfa48ab
commit d1f2a65494
2 changed files with 17 additions and 23 deletions

View File

@ -1,41 +1,45 @@
name: Build Images and push them to Dockerhub name: released image to dockerhub
on: on:
release: release:
types: types:
- published - published
jobs: jobs:
release-image: publish-image-to-dockerhub::
name: Release images name: publish to DockerHub
strategy: strategy:
matrix: matrix:
target: target:
- karmada-aggregated-apiserver
- karmada-controller-manager - karmada-controller-manager
- karmada-scheduler - karmada-scheduler
- karmada-descheduler
- karmada-webhook - karmada-webhook
- karmada-agent - karmada-agent
- karmada-scheduler-estimator - karmada-scheduler-estimator
- karmada-interpreter-webhook-example - karmada-interpreter-webhook-example
- karmada-aggregated-apiserver
runs-on: ubuntu-18.04 runs-on: ubuntu-18.04
steps: steps:
- name: Checkout code - name: checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
# fetch-depth:
# 0 indicates all history for all branches and tags.
# for `git describe --tags` in Makefile.
fetch-depth: 0 fetch-depth: 0
- name: install Go - name: install Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: 1.17.x go-version: 1.17.x
- name: Set up QEMU - name: install QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Buildx - name: install Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
with: with:
username: ${{ secrets.DOCKERHUB_USER_NAME }} username: ${{ secrets.DOCKERHUB_USER_NAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: build and publish images
env: env:
VERSION: ${{ github.ref_name }} VERSION: ${{ github.ref_name }}
run: make mp-image-${{ matrix.target }} run: make mp-image-${{ matrix.target }}

View File

@ -1,10 +0,0 @@
FROM golang:1.17 as builder
COPY karmada /code/karmada
WORKDIR /code/karmada
RUN make _TARGET_
FROM alpine:3.7
RUN apk add -u --no-cache ca-certificates
COPY --from=builder "/code/karmada/_TARGET_" /bin/
CMD ["/bin/_TARGET_"]