Skip to content

Commit 60b71c5

Browse files
authored
Create publish_image_to_dockerhub.yml
1 parent 745a894 commit 60b71c5

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish Docker image on DockerHub
2+
on:
3+
push:
4+
paths:
5+
- 'Dockerfile'
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- uses: actions/checkout@master
12+
with:
13+
fetch-depth: '0'
14+
- name: Bump version and push tag
15+
uses: anothrNick/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
WITH_V: true
19+
id: bump
20+
- name: Create Release
21+
id: create_release
22+
uses: actions/create-release@v1
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
25+
with:
26+
tag_name: ${{ steps.bump.outputs.new_tag }}
27+
release_name: ${{ steps.bump.outputs.new_tag }}
28+
body: |
29+
Changes in this Release
30+
- Rebuilt Docker image and published to DockerHub with new tag
31+
draft: false
32+
prerelease: false
33+
- name: Publish to Registry
34+
uses: elgohr/Publish-Docker-Github-Action@master
35+
with:
36+
name: ubcdsci/intro-to-ds
37+
username: ${{ secrets.DOCKER_USERNAME }}
38+
password: ${{ secrets.DOCKER_PASSWORD }}
39+
tags: "latest,${{ steps.bump.outputs.new_tag }}"
40+

0 commit comments

Comments
 (0)