name: buildx

on:
  pull_request:
    branches: master
  push:
    branches: ["master", "rpi3-arm64"]

jobs:
  buildx:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v1
      -
        name: Set up Docker Buildx
        id: buildx
        uses: crazy-max/ghaction-docker-buildx@v1
        with:
          version: latest
      -
        name: Run Buildx and publish the container to GitHub packages
        run: |
          VERSION=$(date +%s)
          docker buildx build \
            --platform linux/arm64 \
            --output "type=image,push=true" \
            --file ./docker/Dockerfile.rpi3_arm64 \
            --tag docker.pkg.github.com/cchs-melbourne/openpnp-capture-rpi3-arm64:$VERSION .
          docker login docker.pkg.github.com --username cchs-melbourne --password "${{ secrets.GITHUB_TOKEN }}"
          docker push docker.pkg.github.com/cchs-melbourne/openpnp-capture-rpi3-arm64:$VERSION
name: buildx

on:
  pull_request:
    branches: master
  push:
    branches: ["master", "rpi3-arm64"]

jobs:
  buildx:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v1
      -
        name: Set up Docker Buildx
        id: buildx
        uses: crazy-max/ghaction-docker-buildx@v1
        with:
          version: latest
      -
        name: Run Buildx and publish the container to GitHub packages
        run: |
          VERSION=$(date +%s)
          docker buildx build \
            --platform linux/arm64 \
            --output "type=image,push=true" \
            --file ./docker/Dockerfile.rpi3_arm64 \
            --tag docker.pkg.github.com/${{ github.repository }}/openpnp-capture-rpi3-arm64:$VERSION .
          echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com --username ${{ github.actor }} --password-stdin
          docker push docker.pkg.github.com/${{ github.repository }}/openpnp-capture-rpi3-arm64:$VERSION
Use unquoted GITHUB_TOKEN and password-stdin, which is considered to be more secure than --password
Use unquoted GITHUB_TOKEN and password-stdin, which is considered to be more secure than --password
