diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 945790eb..10d6afbb 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,13 +1,25 @@ +name: release-please + on: push: branches: - main -name: release-please + jobs: release-please: runs-on: ubuntu-latest steps: - uses: google-github-actions/release-please-action@v3 + id: release with: release-type: simple - package-name: release-please-action \ No newline at end of file + package-name: release-please-action + outputs: + release_created: ${{ steps.release.outputs.release_created }} + + deploy-prod: + needs: release-please + uses: ./.github/workflows/release-production.yaml + if: ${{ needs.release-please.outputs.release_created }} + secrets: + APP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.APP_SERVICE_ACCOUNT_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/on-release.yaml b/.github/workflows/release-production.yaml similarity index 68% rename from .github/workflows/on-release.yaml rename to .github/workflows/release-production.yaml index c07c9cb5..1e4bdd56 100644 --- a/.github/workflows/on-release.yaml +++ b/.github/workflows/release-production.yaml @@ -1,22 +1,22 @@ -name: "Releases" - -# This action works when creating a release +name: release-to-production on: workflow_dispatch: - release: - types: - - "released" + workflow_call: + secrets: + APP_SERVICE_ACCOUNT_TOKEN: + required: true jobs: tests: uses: ./.github/workflows/tests.yaml - + publish-production: needs: tests uses: ./.github/workflows/publish.yaml with: image-tag: production + oauth-redirect-url: 'https://template-fastapi-react.app.radix.equinor.com' deploy-prod: needs: publish-production