-
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.56 KB
/
build-and-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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
name: 'Docker Image'
on:
workflow_dispatch:
push:
branches:
- 'dev'
- 'master'
tags:
- 'v*.*.*'
paths-ignore:
- .github/**
- deploy/**
- docker-test/**
- docs/**
- .dockerignore
- .gitattributes
- .gitignore
- .lgtm.yml
- .whitesource
- .yarnrc
- docker-compose.yml
- docker-compose-test.yml
- LICENSE
- README.md
- SECURITY.md
env:
IMAGE_NAME: registry.ap-southeast-1.aliyuncs.com/kuops/gundns-admin # 镜像名称
TAG: ${{ github.sha }}
IMAGE_NAME_TAG: registry.ap-southeast-1.aliyuncs.com/kuops/gundns-admin:${{ github.sha }}
jobs:
build-and-push-docker-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build the Docker image and push
run: |
docker login --username=${{ secrets.DOCKER_USERNAME }} registry.ap-southeast-1.aliyuncs.com --password=${{ secrets.DOCKER_PASSWORD }}
echo "************ docker login end"
docker build -t gundns-admin:latest -f ./docker/Dockerfile .
echo "************ docker build end"
echo "************ docker images ps start"
docker images ps
echo "************ docker images ps end"
docker tag gundns-admin ${{ env.IMAGE_NAME_TAG }}
echo "************ docker tag end"
docker images
echo "************ docker images end"
docker push ${{ env.IMAGE_NAME_TAG }} # 推送
echo "************ docker push end"