-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (55 loc) · 1.68 KB
/
dockerpush.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
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: docker build . --file Dockerfile
dockle:
needs: test
name: Dockle validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build image
run: |
docker build --no-cache --force-rm -t dockle-ci-test:latest .
docker image save dockle-ci-test:latest -o dockle-ci-test.tar
chmod 666 dockle-ci-test.tar
- name: Dockle image
run:
docker run -v ${{github.workspace}}/dockle-ci-test.tar:/tmp/dockle-ci-test.tar --rm goodwithtech/dockle:v0.2.4 -d --input /tmp/dockle-ci-test.tar
- name: cleanup
run: |
docker image remove dockle-ci-test:latest
rm ${{github.workspace}}/dockle-ci-test.tar
dockerhub:
needs: dockle
name: Dockerhub publish
runs-on: ubuntu-latest
steps:
- name: Latest tag
run: echo ::save-state name=APP_VERSION::${GITHUB_REF##*/}
- uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
env:
APP_VERSION: ${{env.APP_VERSION}}
with:
name: rvflash/goup
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
buildargs: APP_VERSION
tags: "latest,${{env.APP_VERSION}}"