File tree Expand file tree Collapse file tree 4 files changed +49
-6
lines changed Expand file tree Collapse file tree 4 files changed +49
-6
lines changed Original file line number Diff line number Diff line change 1
- name : Versioning
1
+ name : Publish
2
2
on :
3
3
push :
4
4
tags :
5
5
- ' v*'
6
6
jobs :
7
- publish :
7
+ release :
8
8
name : Publish Release
9
9
runs-on : ubuntu-18.04
10
10
steps :
49
49
tag_name : ${{ github.ref }}
50
50
release_name : v${{ steps.build.outputs.version }}
51
51
body : ${{ steps.build.outputs.release_body }}
52
- draft : true
52
+ draft : false
53
53
prerelease : false
54
54
- name : Upload Asset (darwin)
55
55
78
78
asset_path : ./tmp/build/${{ steps.build.outputs.filename_windows }}
79
79
asset_name : ${{ steps.build.outputs.filename_windows }}
80
80
asset_content_type : application/octet-stream
81
+ docker :
82
+ name : Publish Docker
83
+ runs-on : ubuntu-18.04
84
+ needs :
85
+ - release
86
+ env :
87
+ IMAGE_NAME : gget
88
+ steps :
89
+ - name : Prepare
90
+ id : prepare
91
+ run : |
92
+ version="$( echo "${{ github.ref }}" | sed 's#refs/tags/v##' )"
93
+ echo ::set-output name=version::"$version"
94
+
95
+ image=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
96
+ echo ::set-output name=image::"$image"
97
+ - uses : actions/checkout@v1
98
+ - name : Build Image
99
+ run : |
100
+ docker build build/docker/$IMAGE_NAME \
101
+ --build-arg GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} \
102
+ --build-arg GGET_REF=github.com/${{ github.repository }} \
103
+ --build-arg GGET_VERSION=v${{ steps.prepare.outputs.version }} \
104
+ --tag image
105
+ - name : Registry Login
106
+ run : |
107
+ echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
108
+ - name : Publish Images
109
+ run : |
110
+ for tag in \
111
+ ${{ steps.prepare.outputs.version }} \
112
+ $( echo "${{ steps.prepare.outputs.version }}" | cut -d. -f1-2 ) \
113
+ $( echo "${{ steps.prepare.outputs.version }}" | cut -d. -f1 ) \
114
+ latest \
115
+ ; do
116
+ fqimagetag="${{ steps.prepare.outputs.image }}:v$tag"
117
+ docker tag image $fqimagetag
118
+ docker push $fqimagetag
119
+ done
Original file line number Diff line number Diff line change @@ -68,10 +68,10 @@ go get -u github.com/dpb587/gget
68
68
69
69
## Docker Usage
70
70
71
- The ` dpb587/ gget` image can be used as a build stage for finding and downloading assets for use in a subsequent stage.
71
+ The ` gget ` image can be used as a build stage for finding and downloading assets for use in a subsequent stage.
72
72
73
73
```
74
- FROM dpb587/gget as gget
74
+ FROM docker.pkg.github.com/ dpb587/private /gget as gget
75
75
RUN gget --executable github.com/cloudfoundry/bosh-cli bosh=bosh-cli-*-linux-amd64
76
76
RUN gget --executable github.com/cloudfoundry/bosh-bootloader bbl=bbl-*_linux_x86-64
77
77
RUN gget --stdout github.com/pivotal-cf/om om-linux-*.tar.gz | tar -xzf- om
Original file line number Diff line number Diff line change 1
1
FROM alpine as base
2
2
RUN apk add --no-cache ca-certificates wget
3
3
4
+ ARG GGET_VERSION
5
+ ARG GGET_REF
6
+ ARG GITHUB_TOKEN
4
7
ENV gget /usr/local/bin/gget
5
8
RUN true \
6
9
&& wget -qO "$gget" https://github.com/dpb587/gget/releases/download/v0.1.0/gget-0.1.0-linux-amd64 \
7
10
&& echo "418b68caeb302898322465abc31c316a1dbdb7872cdad0fe4a9661c5118860c4 $gget" | sha256sum -c \
8
11
&& chmod +x "$gget"
9
- RUN gget github.com/dpb587/gget --executable "$gget=gget-*-linux-amd64"
12
+ RUN gget --exec ${GGET_REF:- github.com/dpb587/gget}@${GGET_VERSION:-} "$gget=gget-*-linux-amd64"
10
13
RUN gget --version -v
11
14
12
15
FROM alpine
Original file line number Diff line number Diff line change 1
1
* Renames ` --exec ` to ` --executable `
2
2
* Fixes panic when parsing some release notes for checksums.
3
+ * Automate publishing of Docker images on GitHub Packages.
You can’t perform that action at this time.
0 commit comments