name: Docker
on:
  push:
    tags: ["v?[0-9]+.[0-9]+.([0-9]+)?"]

jobs:
  saw:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          git submodule update --init
          git -C deps/abcBridge submodule update --init
      - run: .github/ci.sh set_version
        id: outputs
      - name: Publish to Registry
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.GITHUBSAW_USERNAME }}
          password: ${{ secrets.GITHUBSAW }}
          repository: galoisinc/saw
          tags: "latest,${{ steps.outputs.outputs.saw-version }}"
          add_git_labels: true
          push: true
  saw-remote-api:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          git submodule update --init
          git -C deps/abcBridge submodule update --init
      - run: .github/ci.sh set_version
        id: outputs
      - name: Publish to Registry
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.GITHUBSAW_USERNAME }}
          password: ${{ secrets.GITHUBSAW }}
          repository: galoisinc/saw-remote-api
          tags: "latest,${{ steps.outputs.outputs.saw-version }}"
          file: Dockerfile-remote-api
          add_git_labels: true
          push: true

name: Docker
on:
  push:
    tags: ["v?[0-9]+.[0-9]+.([0-9]+)?"]
  workflow_dispatch:

jobs:
  saw:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          git submodule update --init
          git -C deps/abcBridge submodule update --init
      - run: .github/ci.sh set_version
        id: outputs
      - name: Publish to Registry
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.GITHUBSAW_USERNAME }}
          password: ${{ secrets.GITHUBSAW }}
          repository: galoisinc/saw
          tags: "latest,${{ steps.outputs.outputs.saw-version }}"
          add_git_labels: true
          push: true
  saw-remote-api:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          git submodule update --init
          git -C deps/abcBridge submodule update --init
      - run: .github/ci.sh set_version
        id: outputs
      - name: Publish to Registry
        uses: docker/build-push-action@v1
        with:
          username: ${{ secrets.GITHUBSAW_USERNAME }}
          password: ${{ secrets.GITHUBSAW }}
          repository: galoisinc/saw-remote-api
          tags: "latest,${{ steps.outputs.outputs.saw-version }}"
          file: Dockerfile-remote-api
          add_git_labels: true
          push: true

Allow manual triggers of versioned Docker builds
Allow manual triggers of versioned Docker builds
