4
4
push :
5
5
branches :
6
6
- master
7
- - release/*
8
7
tags :
9
8
- v*
9
+ pull_request :
10
+ branches :
11
+ - master
12
+ - release/v*
13
+ - release/miner/v*
10
14
schedule :
11
15
- cron : ' 0 0 * * *'
12
16
workflow_dispatch :
13
17
inputs :
14
- ref :
15
- description : The GitHub ref (e.g. refs/tags/v1.0.0) to release
18
+ publish :
19
+ description : ' Publish the Docker image '
16
20
required : false
21
+ default : ' false'
17
22
18
23
defaults :
19
24
run :
@@ -24,7 +29,7 @@ permissions:
24
29
25
30
jobs :
26
31
docker :
27
- name : Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ ( inputs.ref || github.ref) == 'refs/heads/master ' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}]
32
+ name : Docker (${{ matrix.image }} / ${{ matrix.network }}) [publish=${{ github.event. inputs.publish == 'true ' || github.event_name != 'pull_request' }}]
28
33
runs-on : ubuntu-latest
29
34
strategy :
30
35
fail-fast : false
@@ -40,13 +45,13 @@ jobs:
40
45
- image : lotus
41
46
network : mainnet
42
47
env :
43
- PUBLISH : ${{ github.ref == 'refs/heads/master ' || startsWith(inputs.ref || github.ref, 'refs/tags/') }}
48
+ PUBLISH : ${{ github.event.inputs.publish == 'true ' || github.event_name != 'pull_request' }}
44
49
steps :
45
50
- id : channel
46
51
env :
47
- IS_MASTER : ${{ (inputs.ref || github.ref) == 'refs/heads/master' }}
48
- IS_TAG : ${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }}
49
- IS_RC : ${{ contains(inputs.ref || github.ref, '-rc') }}
52
+ IS_MASTER : ${{ github.ref == 'refs/heads/master' }}
53
+ IS_TAG : ${{ startsWith(github.ref, 'refs/tags/') }}
54
+ IS_RC : ${{ contains(github.ref, '-rc') }}
50
55
IS_SCHEDULED : ${{ github.event_name == 'schedule' }}
51
56
run : |
52
57
channel=''
67
72
- uses : actions/checkout@v4
68
73
with :
69
74
submodules : ' recursive'
70
- ref : ${{ inputs.ref || github.ref }}
71
75
- id : git
72
- env :
73
- REF : ${{ inputs.ref || github.ref }}
74
76
run : |
75
- ref="${REF #refs/heads/}"
77
+ ref="${GITHUB_REF #refs/heads/}"
76
78
ref="${ref#refs/tags/}"
77
79
sha="$(git rev-parse --short HEAD)"
78
80
echo "ref=$ref" | tee -a "$GITHUB_OUTPUT"
86
88
images : filecoin/${{ matrix.image }}
87
89
tags : |
88
90
type=raw,enable=${{ steps.channel.outputs.channel != '' }},value=${{ steps.channel.outputs.channel }}
89
- type=raw,enable=${{ startsWith(inputs.ref || github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
91
+ type=raw,enable=${{ startsWith(github.ref, 'refs/tags/') }},value=${{ steps.git.outputs.ref }}
90
92
type=raw,value=${{ steps.git.outputs.sha }}
91
93
flavor : |
92
94
latest=false
0 commit comments