# This workflow triggers github.com/keeps/siegfried-docker on a new release.
name: Docker
on:
  release:
    types: [released]
jobs:
  docker:
    runs-on: ubuntu-latest
    steps:
      - name: Get details of latest release
        run: |
          VERSION=$(curl https://api.github.com/repos/richardlehane/siegfried/releases/latest | grep -Po '\"tag_name\": \"v\K[^\"]*')
          echo "VERSION=$VERSION" >> $GITHUB_ENV
      - name: Repository dispatch
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.KEEPS_ACCESS_TOKEN }}
          repository: 'keeps/siegfried-docker'
          event-type: dispatch
          client-payload: '{"version": "${{ env.VERSION }}"}'