-
-
Notifications
You must be signed in to change notification settings - Fork 49
29 lines (27 loc) · 1 KB
/
docker.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
on:
release:
types: [published]
name: Docker Image
jobs:
publish:
name: build and push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build, tag, and push
env:
DOCKER_HUB_REPO: nanmu42/orly
ALICLOUD_REPO: registry.cn-hongkong.aliyuncs.com/nanmu42/orly
IMAGE_TAG: ${{ github.ref_name }}
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_PASSWORD: ${{ secrets.DOCKER_HUB_PASSWORD }}
ALICLOUD_USER: ${{ secrets.ALICLOUD_USER }}
ALICLOUD_PASSWORD: ${{ secrets.ALICLOUD_PASSWORD }}
run: |
docker login --username $DOCKER_HUB_USER -p $DOCKER_HUB_PASSWORD
docker login --username $ALICLOUD_USER -p $ALICLOUD_PASSWORD registry.cn-hongkong.aliyuncs.com
docker build -t $DOCKER_HUB_REPO:$IMAGE_TAG .
docker tag $DOCKER_HUB_REPO:$IMAGE_TAG $ALICLOUD_REPO:$IMAGE_TAG
docker push $DOCKER_HUB_REPO:$IMAGE_TAG
docker push $ALICLOUD_REPO:$IMAGE_TAG