Skip to content

Commit

Permalink
ci: add docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
d-Rickyy-b committed May 6, 2023
1 parent 420d65e commit bd96695
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Docker Image CI

on:
push:
tags:
- "v*.*.*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Set build tag as env var
run: echo "TAG=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV

- name: Docker login
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/blackjackbot:latest --tag ${{ secrets.DOCKERHUB_USERNAME }}/blackjackbot:${{ env.TAG }}

- name: Push the Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/blackjackbot --all-tags

0 comments on commit bd96695

Please sign in to comment.