Skip to content

Commit 0bc1ec0

Browse files
committed
split out deploy-pr workflows
1 parent 830fcf7 commit 0bc1ec0

1 file changed

Lines changed: 74 additions & 25 deletions

File tree

.github/workflows/pull-request-test.yml

Lines changed: 74 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ jobs:
8888
permissions:
8989
pull-requests: write
9090
id-token: write
91-
if: github.event.action != 'closed' && (needs.check-deploy.outputs.pr-contains-string == 'true' || needs.check-deploy.outputs.azure-deploy == 'true')
92-
# environment:
93-
# name: ci-renku-${{ github.event.number }}
94-
# url: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && format('https://ci-renku-{0}.dev.azure.renku.ch', github.event.number) || format('https://ci-renku-{0}.dev.renku.ch', github.event.number) }}
91+
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true'
92+
environment:
93+
name: ci-renku-${{ github.event.number }}
94+
url: ${{ format('https://ci-renku-{0}.dev.renku.ch', github.event.number) }}
9595
steps:
9696
- uses: actions/checkout@v4.1.7
9797

@@ -110,23 +110,81 @@ jobs:
110110
token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
111111
issue-number: ${{ github.event.pull_request.number }}
112112
body: |
113-
You can access the deployment of this PR at ${{ needs.check-deploy.outputs.azure-deploy == 'true' && format('https://ci-renku-{0}.dev.azure.renku.ch', github.event.number) || format('https://ci-renku-{0}.dev.renku.ch', github.event.number) }}
113+
You can access the deployment of this PR at ${{ format('https://ci-renku-{0}.dev.renku.ch', github.event.number) }}
114+
115+
# Standard deployment setup
116+
- name: Setup standard kubeconfig
117+
if: needs.check-deploy.outputs.pr-contains-string == 'true'
118+
run: |
119+
echo "${{ secrets.RENKUBOT_DEV_KUBECONFIG }}" > "${{ github.workspace }}/renkubot-kube.config"
120+
chmod 600 "${{ github.workspace }}/renkubot-kube.config"
121+
122+
# Deploy Renku
123+
- name: renku build and deploy
124+
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.18.0
125+
env:
126+
DOCKER_PASSWORD: ${{ secrets.RENKU_DOCKER_PASSWORD }}
127+
DOCKER_USERNAME: ${{ secrets.RENKU_DOCKER_USERNAME }}
128+
GITLAB_TOKEN: ${{ secrets.DEV_GITLAB_TOKEN }}
129+
KUBECONFIG: "${{ github.workspace }}/renkubot-kube.config"
130+
RENKU_RELEASE: ci-renku-${{ github.event.number }}
131+
RENKU_VALUES_FILE: "${{ github.workspace }}/values.yaml"
132+
RENKU_VALUES: minimal-deployment/minimal-deployment-values.yaml
133+
RENKUBOT_KUBECONFIG: ${{ secrets.RENKUBOT_DEV_KUBECONFIG }}
134+
RENKUBOT_RANCHER_BEARER_TOKEN: ${{ secrets.RENKUBOT_RANCHER_BEARER_TOKEN }}
135+
TEST_ARTIFACTS_PATH: "tests-artifacts-${{ github.sha }}"
136+
# Component versions
137+
renku: "@${{ github.head_ref }}"
138+
renku_core: "${{ needs.check-deploy.outputs.renku-core }}"
139+
renku_gateway: "${{ needs.check-deploy.outputs.renku-gateway }}"
140+
renku_graph: "${{ needs.check-deploy.outputs.renku-graph }}"
141+
renku_notebooks: "${{ needs.check-deploy.outputs.renku-notebooks }}"
142+
renku_ui: "${{ needs.check-deploy.outputs.renku-ui }}"
143+
renku_data_services: "${{ needs.check-deploy.outputs.renku-data-services }}"
144+
amalthea: "${{ needs.check-deploy.outputs.amalthea }}"
145+
amalthea_sessions: "${{ needs.check-deploy.outputs.amalthea-sessions }}"
146+
extra_values: "${{ needs.check-deploy.outputs.extra-values }}"
147+
148+
deploy-pr-azure:
149+
name: Deploy PR on Azure
150+
runs-on: ubuntu-24.04
151+
needs: [check-deploy]
152+
permissions:
153+
pull-requests: write
154+
id-token: write
155+
if: github.event.action != 'closed' && needs.check-deploy.outputs.azure-deploy == 'true'
156+
steps:
157+
- uses: actions/checkout@v4.1.7
158+
159+
- name: Find deployment url
160+
uses: peter-evans/find-comment@v3
161+
id: deploymentUrlMessage
162+
with:
163+
issue-number: ${{ github.event.pull_request.number }}
164+
comment-author: "RenkuBot"
165+
body-includes: "You can access the deployment of this PR at"
166+
167+
- name: Create comment deployment url
168+
if: steps.deploymentUrlMessage.outputs.comment-id == 0
169+
uses: peter-evans/create-or-update-comment@v4
170+
with:
171+
token: ${{ secrets.RENKUBOT_GITHUB_TOKEN }}
172+
issue-number: ${{ github.event.pull_request.number }}
173+
body: |
174+
You can access the deployment of this PR at ${{ format('https://ci-renku-{0}.dev.azure.renku.ch', github.event.number) }}
114175
# Azure-specific setup
115176
- name: Azure login
116-
if: needs.check-deploy.outputs.azure-deploy == 'true'
117177
uses: azure/login@v2
118178
with:
119179
client-id: ${{ secrets.CI_RENKU_AZURE_CLIENT_ID }}
120180
tenant-id: ${{ secrets.CI_RENKU_AZURE_TENANT_ID }}
121181
subscription-id: ${{ secrets.CI_RENKU_AZURE_SUBSCRIPTION_ID }}
122182
- uses: azure/aks-set-context@v4
123-
if: needs.check-deploy.outputs.azure-deploy == 'true'
124183
with:
125184
resource-group: "renku-dev"
126185
cluster-name: "aks-switzerlandnorth-renku-dev"
127186

128187
- name: Get AKS credentials
129-
if: needs.check-deploy.outputs.azure-deploy == 'true'
130188
run: |
131189
az aks get-credentials --resource-group renku-dev --name aks-switzerlandnorth-renku-dev --file "${{ github.workspace }}/renkubot-kube.config"
132190
chmod 600 "${{ github.workspace }}/renkubot-kube.config"
@@ -137,18 +195,10 @@ jobs:
137195
echo "EOF" >> $GITHUB_ENV
138196
139197
- name: Test kubectl connection
140-
if: needs.check-deploy.outputs.azure-deploy == 'true'
141198
run: |
142199
export KUBECONFIG="${{ github.workspace }}/renkubot-kube.config"
143200
kubectl get nodes
144201
145-
# Standard deployment setup
146-
- name: Setup standard kubeconfig
147-
if: needs.check-deploy.outputs.pr-contains-string == 'true'
148-
run: |
149-
echo "${{ secrets.RENKUBOT_DEV_KUBECONFIG }}" > "${{ github.workspace }}/renkubot-kube.config"
150-
chmod 600 "${{ github.workspace }}/renkubot-kube.config"
151-
152202
# Deploy Renku
153203
- name: renku build and deploy
154204
uses: SwissDataScienceCenter/renku-actions/deploy-renku@v1.18.0
@@ -160,13 +210,12 @@ jobs:
160210
RENKU_RELEASE: ci-renku-${{ github.event.number }}
161211
RENKU_VALUES_FILE: "${{ github.workspace }}/values.yaml"
162212
RENKU_VALUES: minimal-deployment/minimal-deployment-values.yaml
163-
RENKUBOT_KUBECONFIG: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && env.RENKUBOT_KUBECONFIG || secrets.RENKUBOT_DEV_KUBECONFIG }}
164-
RENKUBOT_RANCHER_BEARER_TOKEN: ${{ needs.check-deploy.outputs.azure-deploy != 'true' && secrets.RENKUBOT_RANCHER_BEARER_TOKEN || '' }}
213+
RENKUBOT_KUBECONFIG: ${{ env.RENKUBOT_KUBECONFIG }}
165214
TEST_ARTIFACTS_PATH: "tests-artifacts-${{ github.sha }}"
166215
# Azure-specific env vars
167-
KUBERNETES_CLUSTER_FQDN: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && 'dev.azure.renku.ch' || '' }}
168-
RENKU_ANONYMOUS_SESSIONS: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && 'true' || '' }}
169-
ENABLE_NGINX_INGRESS: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && 'true' || '' }}
216+
KUBERNETES_CLUSTER_FQDN: 'dev.azure.renku.ch'
217+
RENKU_ANONYMOUS_SESSIONS: 'true'
218+
ENABLE_NGINX_INGRESS: 'true'
170219
# Component versions
171220
renku: "@${{ github.head_ref }}"
172221
renku_core: "${{ needs.check-deploy.outputs.renku-core }}"
@@ -182,7 +231,7 @@ jobs:
182231
legacy-scala-tests:
183232
name: Legacy Scala tests
184233
runs-on: ubuntu-24.04
185-
needs: [check-deploy, deploy-pr]
234+
needs: [check-deploy, deploy-pr, deploy-pr-azure]
186235
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true' && needs.check-deploy.outputs.test-legacy-enabled == 'true'
187236
steps:
188237
- uses: SwissDataScienceCenter/renku-actions/test-renku@v1.17.0
@@ -197,7 +246,7 @@ jobs:
197246
legacy-cypress-acceptance-tests:
198247
name: Legacy Cypress tests
199248
runs-on: ubuntu-24.04
200-
needs: [check-deploy, deploy-pr]
249+
needs: [check-deploy, deploy-pr, deploy-pr-azure]
201250
if: github.event.action != 'closed' && needs.check-deploy.outputs.pr-contains-string == 'true' && needs.check-deploy.outputs.test-legacy-enabled == 'true'
202251
strategy:
203252
fail-fast: false
@@ -224,7 +273,7 @@ jobs:
224273
cypress-acceptance-tests:
225274
name: Cypress tests
226275
runs-on: ubuntu-24.04
227-
needs: [check-deploy, deploy-pr]
276+
needs: [check-deploy, deploy-pr, deploy-pr-azure]
228277
strategy:
229278
fail-fast: false
230279
matrix:
@@ -244,7 +293,7 @@ jobs:
244293
with:
245294
e2e-folder: cypress/e2e/v2/
246295
e2e-target: ${{ matrix.tests }}
247-
kubernetes-cluster-fqdn: dev.azure.renku.ch
296+
kubernetes-cluster-fqdn: ${{ needs.check-deploy.outputs.azure-deploy == 'true' && 'dev.azure.renku.ch' || '' }}
248297
renku-reference: ${{ github.ref }}
249298
renku-release: ci-renku-${{ github.event.number }}
250299
test-user-password: ${{ secrets.RENKU_BOT_DEV_PASSWORD }}

0 commit comments

Comments
 (0)