-
Notifications
You must be signed in to change notification settings - Fork 22
53 lines (45 loc) · 1.1 KB
/
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
---
name: DockerHub CI
on:
push:
branches:
- master
- releases/*
paths:
- 'Dockerfile'
pull_request:
env:
DOCKER_IMAGE_NAME: gofrolist/molecule
DOCKER_FILE: Dockerfile
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build Docker image
run: >
docker build . --file ${DOCKER_FILE}
-t ${DOCKER_IMAGE_NAME}:${GITHUB_SHA}
-t ${DOCKER_IMAGE_NAME}:latest
- name: Login to Docker registry
run: >
echo "${{ secrets.DOCKERHUB_TOKEN }}" |
docker login
-u ${{ secrets.DOCKERHUB_USER }}
--password-stdin
- name: Push Docker image
run: |
docker push ${DOCKER_IMAGE_NAME}:${GITHUB_SHA}
docker push ${DOCKER_IMAGE_NAME}:latest
molecule:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
path: "${{ github.repository }}"
- name: Molecule
uses: docker://gofrolist/molecule:latest
with:
molecule_options: --version