Skip to content

Build and push docker image of gateway when changes are pushed to the main branch #5

Build and push docker image of gateway when changes are pushed to the main branch

Build and push docker image of gateway when changes are pushed to the main branch #5

name: Build and push docker image of gateway when changes are pushed to the main branch
on:
push:
branches:
- main
paths:
- 'GatewayService/**'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./GatewayService
file: ./GatewayService/Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/gateway-srv:latest