File tree Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Expand file tree Collapse file tree 2 files changed +43
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Docker Main Build
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ docker :
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+
14
+ - name : Set build tag
15
+ id : build_tag_generator
16
+ run : |
17
+ RELEASE_TAG=$(curl https://api.github.com/repos/hyperledger/firefly-dataexchange-https/releases/latest -s | jq .tag_name -r)
18
+ BUILD_TAG=$RELEASE_TAG-$(date +"%Y%m%d")-$GITHUB_RUN_NUMBER
19
+ echo ::set-output name=BUILD_TAG::$BUILD_TAG
20
+
21
+ - name : Build
22
+ run : |
23
+ docker build \
24
+ --label commit=$GITHUB_SHA \
25
+ --label build_date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
26
+ --label tag=${{ steps.build_tag_generator.outputs.BUILD_TAG }} \
27
+ --tag ghcr.io/hyperledger/firefly-dataexchange-https:${{ steps.build_tag_generator.outputs.BUILD_TAG }} .
28
+
29
+ - name : Tag release
30
+ run : docker tag ghcr.io/hyperledger/firefly-dataexchange-https:${{ steps.build_tag_generator.outputs.BUILD_TAG }} ghcr.io/hyperledger/firefly-dataexchange-https:head
31
+
32
+ - name : Push docker image
33
+ run : |
34
+ echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
35
+ docker push ghcr.io/hyperledger/firefly-dataexchange-https:${{ steps.build_tag_generator.outputs.BUILD_TAG }}
36
+
37
+ - name : Push head tag
38
+ run : |
39
+ echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
40
+ docker push ghcr.io/hyperledger/firefly-dataexchange-https:head
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: Docker
2
2
3
3
on :
4
4
release :
5
- types : [published , prereleased]
5
+ types : [released , prereleased]
6
6
7
7
jobs :
8
8
docker :
14
14
run : docker build -t ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} .
15
15
16
16
- name : Tag release
17
- if : github.event.action == 'published '
17
+ if : github.event.action == 'released '
18
18
run : docker tag ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/} ghcr.io/hyperledger/firefly-dataexchange-https:latest
19
19
20
20
- name : Push docker image
23
23
docker push ghcr.io/hyperledger/firefly-dataexchange-https:${GITHUB_REF##*/}
24
24
25
25
- name : Push latest tag
26
- if : github.event.action == 'published '
26
+ if : github.event.action == 'released '
27
27
run : |
28
28
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
29
29
docker push ghcr.io/hyperledger/firefly-dataexchange-https:latest
You can’t perform that action at this time.
0 commit comments