name: Build and Push pyAFQ Docker Image

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v1

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

    - name: Login to GHCR
      uses: docker/login-action@v1 
      with:
        registry: ghcr.io
        username: nrdg
        password: ${{secrets.CR_PAT_NRDG}}

    - name: Checkout repo
      uses: actions/checkout@v1

    - name: Build and push pyAFQ docker image
      run: sh ./pyafq_docker/docker-build.sh \
        "${{github.sha}}" \
        "nrdg"

name: Build and Push pyAFQ Docker Image

on:
  push:
    branches:
      - 'master'
  pull_request:
    branches:
      - main


jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Set up QEMU
      uses: docker/setup-qemu-action@v1

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

    - name: Login to GHCR
      uses: docker/login-action@v1 
      with:
        registry: ghcr.io
        username: nrdg
        password: ${{secrets.CR_PAT_NRDG}}

    - name: Checkout repo
      uses: actions/checkout@v1

    - name: Build and push pyAFQ docker image
      run: sh ./pyafq_docker/docker-build.sh \
        "${{github.sha}}" \
        "nrdg"

Build and push pyAFQ docker image only after merge
Build and push pyAFQ docker image only after merge
