Skip to content

Commit

Permalink
Add Docker build in github action (#22)
Browse files Browse the repository at this point in the history
* Create docker build action

* Update docker

* Rename docker to docker.yml
  • Loading branch information
KylinMountain authored Aug 23, 2024
1 parent 94937db commit d5f4a95
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image CI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:

runs-on: ubuntu-latest

env:
IMAGE_NAME: ${{ github.event.repository.name }}

steps:
- uses: actions/checkout@v4

- name: Log in to DockerHub
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin

- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}

- name: Push the Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}

0 comments on commit d5f4a95

Please sign in to comment.