-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 1.68 KB
/
main.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
56
57
58
59
60
61
62
63
64
name: 将镜像上传到个人私有镜像仓库
on:
workflow_dispatch:
inputs:
oldimage_name:
description: '旧镜像名称'
imges_url:
description: '镜像仓库'
default: 'registry.cn-beijing.aliyuncs.com/duxiao'
server_name:
description: '服务名称'
tag_name:
description: '镜像tag'
# push:
# paths:
# - '.github/workflows/**'
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: pull
run: |
docker login -u ${{ secrets.ALI_USER}} -p ${{ secrets.ALI_PASSWORD}} registry.cn-beijing.aliyuncs.com/duxiao
docker pull ${{ github.event.inputs.oldimage_name }}
docker tag ${{ github.event.inputs.oldimage_name }} ${{ github.event.inputs.imges_url }}/${{ github.event.inputs.server_name }}:${{ github.event.inputs.tag_name }}
echo ${{ github.event.inputs.imges_url }}/${{ github.event.inputs.server_name }}:${{ github.event.inputs.tag_name }}
docker push ${{ github.event.inputs.imges_url }}/${{ github.event.inputs.server_name }}:${{ github.event.inputs.tag_name }}
#mkdir artifacts
#mv jenkins.tar artifacts/
# #- uses: actions/upload-artifact@v2
# with:
# name: artifacts
# path: artifacts/*
# job1:
# runs-on: ubuntu-latest
# steps:
# - run: echo "job1"
# job2:
# runs-on: ubuntu-latest
# steps:
# - run: sleep 5
# needs: job1
# job3:
# runs-on: ubuntu-latest
# steps:
# - run: sleep 10
# needs: job1
# job4:
# runs-on: ubuntu-latest
# steps:
# - run: echo "job4"
# needs: [job2, job3]