-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (70 loc) · 2.15 KB
/
octopusRelease.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Octopus
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
OCTOPUS_SPACE: "Default"
OCTOPUS_PROJECT: "Data Ingestion Building Blocks"
jobs:
release-version:
name: Get 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-action@v3
with:
project: ${{ env.OCTOPUS_PROJECT }}
release_number: ${{ needs.octopus-release.outputs.release_number }}
environments: |
Development