-
Notifications
You must be signed in to change notification settings - Fork 168
33 lines (30 loc) · 1.12 KB
/
image-publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# refers:
# https://docs.docker.com/ci-cd/github-actions/
# https://docs.github.com/cn/actions/guides/publishing-docker-images
name: Publish Docker Images
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push images to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
with:
fetch-depth: 0
path: ./src/github.com/${{ github.repository }}
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Run push images
run: |
# ${GITHUB_REPOSITORY} => kubeedge/sedna
# ${GITHUB_REF} => refs/tags/v0.0.1
# IMAGE_REPO=kubeedge IMAGE_TAG=v0.0.1
# see https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
make push-all IMAGE_REPO=$(echo ${GITHUB_REPOSITORY%/*} | tr A-Z a-z) IMAGE_TAG=${GITHUB_REF#refs/*/}
working-directory: ./src/github.com/${{ github.repository }}