Update main.go #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release - Pull Request | |
on: | |
pull_request: | |
branches: [ "main" ] | |
env: | |
OCTOPUS_SPACE: 'SHIPPED23' | |
jobs: | |
build-and-push-image: | |
uses: MJRichardson/shipped23/.github/workflows/build-and-push-image.yaml@provision-env | |
provision-environment-and-deploy: | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
runs-on: ubuntu-latest | |
needs: build-and-push-image | |
steps: | |
- name: Login to Octopus π | |
uses: OctopusDeploy/login@v1 | |
with: | |
server: https://michrich.octopus.app | |
service_account_id: 1269d528-af54-4ab9-8a4b-902ac894a865 | |
- name: Provision branch environment π | |
id: provision-branch-environment | |
uses: OctopusDeploy/run-runbook-action@v3 | |
with: | |
project: 'SHIPPED23' | |
runbook: 'Create branch environment' | |
variables: | | |
Branch:${{needs.build-and-push-image.outputs.branch}} | |
environments: | | |
Branch Template | |
- name: Wait for environment to provision π | |
uses: OctopusDeploy/await-task-action@v3 | |
with: | |
server_task_id: ${{ fromJson(steps.provision-branch-environment.outputs.server_tasks)[0].serverTaskId }} | |
- name: Create a release in Octopus Deploy π | |
uses: OctopusDeploy/create-release-action@v3 | |
with: | |
project: 'SHIPPED23' | |
channel: ${{ needs.build-and-push-image.outputs.branch }} | |
release_number: ${{ needs.build-and-push-image.outputs.branch }}.${{ github.run_id }} | |
package_version: ${{ needs.build-and-push-image.outputs.branch }}.${{ github.run_id }} | |
git_ref: ${{ (github.ref_type == 'tag' && github.event.repository.default_branch ) || (github.head_ref || github.ref) }} | |
git_commit: ${{ github.event.after || github.event.pull_request.head.sha }} |