mancala/.github/workflows/build-and-deploy.yaml

26 lines
639 B
YAML

name: Build & Deploy Docker Image
on:
push:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: little-core-labs/get-git-tag@v3.0.1
id: tagName
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: docker build ./backend -t jhalitaksoy/mancala-backend:$GIT_TAG_NAME
- name: Push the Docker image
run: docker push jhalitaksoy/mancala-backend:$GIT_TAG_NAME