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

23 lines
614 B
YAML

name: Build & Deploy Docker Image
on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?(\.[0-9]+)?'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- 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 . -t jhalitaksoy/mancala-backend:$GIT_TAG_NAME
- name: Push the Docker image
run: docker push jhalitaksoy/mancala-backend:$GIT_TAG_NAME