name: Deploy to Porter
on:
  push:
    branches: [main]
concurrency: porter-deploy-${{ github.ref }}
jobs:
  deploy:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - id: vars
        run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
      - uses: porter-dev/setup-porter@v0.1.0
      - run: exec porter apply --wait -f porter.yaml
        timeout-minutes: 30
        env:
          PORTER_HOST: https://dashboard.internal-tools.porter.run
          PORTER_PROJECT: "8"
          PORTER_CLUSTER: "651"
          PORTER_TOKEN: ${{ secrets.PORTER_TOKEN }}
          PORTER_TAG: ${{ steps.vars.outputs.sha_short }}
          PORTER_STACK_NAME: midnight-badger-721166
          PORTER_ADDON_YAML: "true"
