-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (24 loc) · 938 Bytes
/
publish.yml
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
name: Publish Docker Image
on:
workflow_call:
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Print image tag before test
run: |
echo "Image Tag: ${{ github.sha }}"
- name: Log in to Docker registry
run: |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login harbor.main.rise-ck8s.com -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Pull image before tagging as latest
run: docker pull harbor.main.rise-ck8s.com/des-public/tutorials:${{ github.sha }}
- name: Tag Docker image as "latest" and push
run: |
docker tag harbor.main.rise-ck8s.com/des-public/tutorials:${{ github.sha }} harbor.main.rise-ck8s.com/des-public/tutorials:latest
docker push harbor.main.rise-ck8s.com/des-public/tutorials:latest