Skip to content

Commit 0813c01

Browse files
Create docker-image.yml
1 parent e8c43ee commit 0813c01

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/docker-image.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Get the git tag
15+
id: get_tag
16+
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
17+
18+
- name: Build the Docker image
19+
run: docker build . --file Dockerfile --tag icomputerfreak/notifier-bot:${{ steps.get_tag.outputs.tag }}
20+
21+
- name: Log in to Docker Hub
22+
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
23+
24+
- name: Tag the Docker image as latest
25+
run: docker tag icomputerfreak/notifier-bot:${{ steps.get_tag.outputs.tag }} icomputerfreak/notifier-bot:latest
26+
27+
- name: Push the Docker image to Docker Hub
28+
run: |
29+
docker push icomputerfreak/notifier-bot:${{ steps.get_tag.outputs.tag }}
30+
docker push icomputerfreak/notifier-bot:latest

0 commit comments

Comments
 (0)