Skip to content

Docker Image CI

Docker Image CI #5

Workflow file for this run

name: Docker Image CI
on:
workflow_dispatch:
push:
branches: [main]
paths:
- 'src/**'
pull_request:
branches: [main]
paths:
- 'src/**'
defaults:
run:
working-directory: src/SampleApi
jobs:
build:
environment: docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_LOGIN_SERVER }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/sampleapi:latest
${{ secrets.DOCKER_USERNAME }}/sampleapi:${{ github.sha }}