File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Release Containers
2
+
3
+ on :
4
+ push :
5
+ tags : [ 'v*' ]
6
+
7
+
8
+ jobs :
9
+ release-containers :
10
+ name : Build and Push
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+
14
+ - uses : actions/checkout@v2
15
+
16
+ - name : Login to ghcr.io Docker registry
17
+ uses : docker/login-action@v1
18
+ with :
19
+ registry : ghcr.io
20
+ username : ${{ github.repository_owner }}
21
+ password : ${{ secrets.GITHUB_TOKEN }}
22
+
23
+ - name : Compute Docker container image addresses
24
+ run : |
25
+ DOCKER_REPOSITORY="ghcr.io/${GITHUB_REPOSITORY,,}"
26
+ DOCKER_TAG="${GITHUB_REF:11}"
27
+ echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
28
+ echo "DOCKER_TAG=${DOCKER_TAG}" >> $GITHUB_ENV
29
+ echo "Using: ${DOCKER_REPOSITORY}/*:${DOCKER_TAG}"
30
+ - name : ' Pull latest existing Docker container image: server'
31
+ run : docker pull "${DOCKER_REPOSITORY}/server:latest" || true
32
+
33
+ - name : ' Build Docker container image: server'
34
+ run : |
35
+ docker build \
36
+ --cache-from "${DOCKER_REPOSITORY}/server:latest" \
37
+ --tag "${DOCKER_REPOSITORY}/server:latest" \
38
+ --tag "${DOCKER_REPOSITORY}/server:${DOCKER_TAG}" \
39
+ .
40
+
41
+ - name : Push Docker container image server:latest"
42
+ run : docker push "${DOCKER_REPOSITORY}/server:latest"
43
+
44
+ - name : Push Docker container image server:v*"
45
+ run : docker push "${DOCKER_REPOSITORY}/server:${DOCKER_TAG}"
You can’t perform that action at this time.
0 commit comments