Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. on:

    Code Block
    on:
      push:
        # Publish `master` as Docker `master` tag.
        # See also https://github.com/crazy-max/ghaction-dor-meta#basic
        branches:
          - master
    
        # Publish `v1.2.3` tags as releases.
        tags:
          - v*
    
      pull_request:
        # Run Tests when changes are made to the Docker file
        paths:
          - 'Dockerfile'
    
      workflow_dispatch:
        inputs:
          customTag:
            description: "Includes the specified tag to docker image tags"
            required: false
    1. Here we specify when the workflow should be triggered. On the above scenario we have the workflow being triggered when:

      1. Push - These actions trigger docker build and publishing of the image on DockerHub or Github Container registry.

        1. Commits are pushed to master branch.

        2. Git tag prefixed with v* are pushed to the repository.

      2. Pull Request - When a pull request is created with changes on the Dockerfile a docker build is triggered to ensure that docker build goes smoothly.

      3. Workflow Dispatch (Manual Trigger)

        1. This allows one to manually trigger the workflow to build and publish docker image to the respective repositories. One can choose which branch to use or/and which name to use for the of the docker image, if the tag section is left as blank the branch name can will be used.

  2. jobs:

    1. Here we list the jobs or tasks for the workflow. We have two jobs namely: test and push

      1. test: Responsible for testing the docker image build process.

...