Deploy and Octopus workflows #38
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: Octopus | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
env: | |
OCTOPUS_SPACE: 'Default' | |
OCTOPUS_PROJECT: 'Data Ingestion Building Blocks' | |
jobs: | |
release-version: | |
permissions: | |
contents: write | |
outputs: | |
version: ${{ steps.get_version.outputs.version }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" | |
ref: "main" | |
- name: Install poetry and dependencies | |
run: pip install poetry | |
# update the version number in the phdi/__init.py__ file | |
- name: Get PHDI Version | |
id: get_version | |
run: | | |
VERSION_WITH_PHDI=$(poetry version) | |
echo "version=${VERSION_WITH_PHDI:5}" >> $GITHUB_OUTPUT | |
octopus-release: | |
runs-on: ubuntu-latest | |
needs: release-version | |
permissions: | |
id-token: write # Required for authentication | |
outputs: | |
release_number: ${{ steps.create_release.outputs.release_number }} | |
steps: | |
- name: Login to Octopus π | |
uses: OctopusDeploy/login@v1 | |
with: | |
server: ${{ secrets.OCTOPUS_URL }} | |
service_account_id: ${{ secrets.OCTOPUS_SERVICE_ACCOUNT_ID }} | |
- name: Create a release in Octopus π | |
uses: OctopusDeploy/create-release-action@v3 | |
id: create_release | |
with: | |
project: ${{ env.OCTOPUS_PROJECT }} | |
channel: "Channel alis/46" | |
package_version: ${{ needs.release-version.outputs.version }} | |
octopus-deployments: | |
runs-on: ubuntu-latest | |
needs: octopus-release | |
permissions: | |
id-token: write # Required for authentication | |
steps: | |
- name: Login to Octopus π | |
uses: OctopusDeploy/login@v1 | |
with: | |
server: ${{ secrets.OCTOPUS_URL }} | |
service_account_id: ${{ secrets.OCTOPUS_SERVICE_ACCOUNT_ID }} | |
- name: Deploy a release in Octopus Deploy π | |
uses: OctopusDeploy/deploy-release-tenanted-action@v3 | |
with: | |
project: ${{ env.OCTOPUS_PROJECT }} | |
release_number: ${{ needs.octopus-release.outputs.release_number }} | |
tenants: CDC EXT | |
environments: Development |