name: Publish Docker image for CircleCI

on:
  push:
    paths:
      - .github/workflows/docker-image-for-circle-ci.yml
      - .circleci/Dockerfile
      - .circleci/run_commands
  pull_request:
    paths:
      - .github/workflows/docker-image-for-circle-ci.yml
      - .circleci/Dockerfile
      - .circleci/run_commands

  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1

      - name: Login to GitHub Container Registry
        uses: docker/login-action@v1
        with:
          registry: ghcr.io
          username: ${{ github.repository_owner }}
          password: ${{ secrets.CR_PAT }}
      
      - name: Build and push Docker images
        uses: docker/build-push-action@v2.3.0
        with:
          context: .circleci
          push: true
          tags: ghcr.io/${{ github.repository_owner }}/circleci_ubuntu-20.04:latest

Add GitHub action to build CircleCI Docker image
Add GitHub action to build CircleCI Docker image
