# File generated by bin/generate-actions-yaml.sh
name: ci

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:
  build-images:
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
      -
        name: Cache Docker layers
        uses: actions/cache@v2
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-
      -
        name: Login to DockerHub
        uses: docker/login-action@v1 
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build images
        run: ./bin/build-images.sh
      -
        name: Push images
        if: ${{ github.event_name != 'pull_request' }}
        run: ./bin/push-images.sh
