-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 1.7 KB
/
publish-dockerhub.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
60
61
name: Publish to DockerHub
on:
push:
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
# TODO: Change variable to your image's name.
IMAGE_NAME: image
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: |
if [ -f docker-compose.test.yml ]; then
docker-compose --file docker-compose.test.yml build
docker-compose --file docker-compose.test.yml run sut
else
docker build . --file Dockerfile
fi
# Push image to DockerHub.
# See also https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-docker-images#publishing-images-to-docker-hub
push:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
username: sakuraiyouhei
password: ${{ secrets.DOCKER_PASSWORD }}
repository: sakuraiyouhei/shukujitsu
tags: latest
tag_with_ref: true
# https://github.com/peter-evans/dockerhub-description/issues/10
# https://github.com/peter-evans/dockerhub-description/issues/24
# https://github.com/docker/roadmap/issues/115
# dockerHubDescription:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
#
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v2
# with:
# username: sakuraiyouhei
# password: ${{ secrets.DOCKER_PASSWORD }}
# repository: sakuraiyouhei/shukujitsu