name: Publish Docker image for release

on:
  push:
    tags:
      - '*.*.*'
      - '!*-*'

permissions:
  contents: write
  packages: write

jobs:
  docker_publish:
    uses: ./.github/workflows/docker.yml
    with:
      add_latest: true
    secrets:
      DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
      DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
      DOCKER_USERNAME_2: ${{ secrets.DOCKER_USERNAME_2 }}
      DOCKER_PASSWORD_2: ${{ secrets.DOCKER_PASSWORD_2 }}

  github_release:
    needs: docker_publish
    uses: ./.github/workflows/github.yml
    with:
      prerelease: false
      make_latest: true
      discord_title: "||@release-dashboard|| New release published"
      discord_color: 5814783
      discord_footer: "Portabase"
    secrets:
      DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}