Skip to content

Workflow file for this run

name: Build and Publish Docker Image to Docker Hub
on:
workflow_dispatch:
release:
types: [published]
jobs:
build:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3
- name: DockerHub Login
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Read YAML file for version
uses: pietrobolcato/action-read-yaml@1.0.0
id: read_yaml
with:
config: ${{ github.workspace }}/version.yaml
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/oswp:${{ steps.read_yaml.outputs['version'] }}
- name: Docker Push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/oswp:${{ steps.read_yaml.outputs['version'] }}