Skip to content

Commit a81c785

Browse files
authored
Revert "Revert "New deployment no ports""
1 parent 57c83c7 commit a81c785

18 files changed

+87
-51
lines changed

.github/actions/build-node/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ inputs:
2929
run_webpack:
3030
default: false
3131
required: false
32+
disable_cache:
33+
description: "Set to true to disable caching"
34+
default: false
35+
required: false
3236

3337
runs:
3438
using: "composite"
@@ -59,6 +63,7 @@ runs:
5963
name: node-yarn-lock
6064
# Enable yarn download cache, @see https://github.com/actions/cache/tree/main/save#always-save-cache and https://github.com/actions/setup-node/issues/325
6165
- name: Restore yarn cache
66+
if: inputs.disable_cache == 'false'
6267
uses: actions/cache/restore@v3
6368
with:
6469
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
@@ -71,8 +76,8 @@ runs:
7176
run: yarn install --no-immutable --inline-builds
7277
shell: bash
7378
- name: Save yarn cache
79+
if: inputs.disable_cache == 'false' && steps.install.outcome == 'success'
7480
uses: actions/cache/save@v3
75-
if: steps.install.outcome == 'success'
7681
with:
7782
# This path is the global yarn cache, because for some reason the local .yarn/cache is not used. Maybe we need to set the cacheFolder, enableGlobalCache, ... options differently? @see https://yarnpkg.com/configuration/yarnrc#cacheFolder
7883
path: ~/.yarn/berry/cache/

.github/actions/build-python/action.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,26 @@ inputs:
2020
run_build:
2121
default: true
2222
required: false
23+
disable_cache:
24+
description: "Set to true to disable caching"
25+
default: false
26+
required: false
2327

2428
runs:
2529
using: "composite"
2630
steps:
27-
- name: Set up python
31+
- name: Set up python (with cache)
32+
if: inputs.disable_cache == 'false'
2833
uses: actions/setup-python@v3
2934
with:
3035
python-version: ${{ inputs.python_version }}
3136
cache: 'pip'
3237
# needs wheel for make
38+
- name: Set up python (without cache)
39+
if: inputs.disable_cache == 'true'
40+
uses: actions/setup-python@v3
41+
with:
42+
python-version: ${{ inputs.python_version }}
3343
- name: install additional requirements
3444
run: |
3545
pip install setuptools wheel

.github/workflows/build-node-python.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ on:
5757
type: string
5858
required: false
5959
default: "ubuntu-22.04-large"
60+
#disable_cache:
61+
# description: "Set to true to disable caching"
62+
# required: false
63+
# type: boolean
64+
# default: false
6065
secrets:
6166
DATAVISYN_BOT_REPO_TOKEN:
6267
required: false
@@ -75,7 +80,8 @@ env:
7580
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
7681
PYPI_USERNAME: "datavisyn"
7782
PYTHON_VERSION: "3.10"
78-
WORKFLOW_BRANCH: "new_deployment"
83+
WORKFLOW_BRANCH: "new_deployment_no_ports"
84+
POSTGRES_HOSTNAME: postgres_${{ inputs.branch }}_${{ github.run_id }}
7985

8086
permissions:
8187
contents: read
@@ -94,12 +100,12 @@ jobs:
94100
runs-on: ${{ inputs.runs_on }}
95101
steps:
96102
- name: Checkout source repository
97-
uses: actions/checkout@v3
103+
uses: actions/checkout@v4
98104
with:
99105
ref: ${{ inputs.branch }}
100106
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
101107
- name: Checkout github-workflows
102-
uses: actions/checkout@v3
108+
uses: actions/checkout@v4
103109
with:
104110
repository: datavisyn/github-workflows
105111
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -111,6 +117,7 @@ jobs:
111117
npm_registry: ${{ env.NPM_REGISTRY }}
112118
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
113119
run_webpack: ${{ inputs.node_run_webpack }}
120+
#disable_cache: ${{ inputs.disable_cache }}
114121

115122
build-python:
116123
name: Python
@@ -121,12 +128,12 @@ jobs:
121128
runs-on: ${{ inputs.runs_on }}
122129
steps:
123130
- name: Checkout source repository
124-
uses: actions/checkout@v3
131+
uses: actions/checkout@v4
125132
with:
126133
ref: ${{ inputs.branch }}
127134
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
128135
- name: Checkout github-workflows
129-
uses: actions/checkout@v3
136+
uses: actions/checkout@v4
130137
with:
131138
repository: datavisyn/github-workflows
132139
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -136,7 +143,7 @@ jobs:
136143
with:
137144
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
138145
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
139-
146+
#disable_cache: ${{ inputs.disable_cache }}
140147
# If cypress is used, build node and python sequentially as it is avoiding the duplicate install overhead
141148
build-node-python-cypress:
142149
name: Node, Python, Cypress
@@ -161,17 +168,21 @@ jobs:
161168
--health-interval 10s
162169
--health-timeout 5s
163170
--health-retries 5
164-
ports:
165-
- 5432:5432
171+
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
166172
167173
steps:
174+
- name: Set system env variable to github env
175+
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
176+
- name: Connect service to default network
177+
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
178+
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
168179
- name: Checkout source repository
169-
uses: actions/checkout@v3
180+
uses: actions/checkout@v4
170181
with:
171182
ref: ${{ inputs.branch }}
172183
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
173184
- name: Checkout github-workflows
174-
uses: actions/checkout@v3
185+
uses: actions/checkout@v4
175186
with:
176187
repository: datavisyn/github-workflows
177188
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -183,11 +194,13 @@ jobs:
183194
npm_registry: ${{ env.NPM_REGISTRY }}
184195
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
185196
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
197+
#disable_cache: ${{ inputs.disable_cache }}
186198
- name: Build python
187199
uses: ./tmp/github-workflows/.github/actions/build-python
188200
with:
189201
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
190202
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
203+
#disable_cache: ${{ inputs.disable_cache }}
191204
- name: Decrypt .env.enc and <app>/.env.enc
192205
run: |
193206
yarn run env:decrypt -pass env:ENV_PASSWORD || true
@@ -210,6 +223,8 @@ jobs:
210223
make start
211224
wait-on: "http://localhost:8080, http://localhost:9000/health"
212225
env: ${{ secrets.CYPRESS_ENV }}
226+
env:
227+
POSTGRES_HOSTNAME: ${{ env.POSTGRES_HOSTNAME }}
213228
- name: Run cypress component tests
214229
uses: cypress-io/github-action@v6
215230
with:
@@ -257,17 +272,21 @@ jobs:
257272
--health-interval 10s
258273
--health-timeout 5s
259274
--health-retries 5
260-
ports:
261-
- 5432:5432
275+
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
262276
263277
steps:
278+
- name: Set system env variable to github env
279+
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
280+
- name: Connect service to default network
281+
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
282+
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
264283
- name: Checkout source repository
265-
uses: actions/checkout@v3
284+
uses: actions/checkout@v4
266285
with:
267286
ref: ${{ inputs.branch }}
268287
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
269288
- name: Checkout github-workflows
270-
uses: actions/checkout@v3
289+
uses: actions/checkout@v4
271290
with:
272291
repository: datavisyn/github-workflows
273292
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -279,11 +298,13 @@ jobs:
279298
npm_registry: ${{ env.NPM_REGISTRY }}
280299
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
281300
run_webpack: false # Disable the build here and call afterwards, as otherwise the yarn run env:decrypt will fail due to a missing yarn install
301+
#disable_cache: ${{ inputs.disable_cache }}
282302
- name: Build python
283303
uses: ./tmp/github-workflows/.github/actions/build-python
284304
with:
285305
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
286306
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
307+
#disable_cache: ${{ inputs.disable_cache }}
287308
- name: Decrypt .env.enc and <app>/.env.enc
288309
run: |
289310
yarn run env:decrypt -pass env:ENV_PASSWORD || true

.github/workflows/build-node.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ jobs:
3737
runs-on: ubuntu-22.04
3838
steps:
3939
# checkout specific source repository
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
with:
4242
ref: ${{ inputs.branch }}
4343
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }} # has to set because otherwise it will not work
4444
# checkout this workflow repository to get actions
45-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
4646
with:
4747
repository: datavisyn/github-workflows
4848
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-product.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ jobs:
5757
runs-on: ubuntu-22.04
5858
steps:
5959
# checkout specific repository
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
# checkout this workflow repository to get actions
62-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
6363
with:
6464
repository: datavisyn/github-workflows
6565
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -118,7 +118,7 @@ jobs:
118118
if: ${{ always() && (needs.build-single.result == 'success' || needs.build-single.result == 'skipped') && (needs.build-workspace.result == 'success' || needs.build-workspace.result == 'skipped') && !(needs.build-workspace.result == 'skipped' && needs.build-single.result == 'skipped')}}
119119
runs-on: ubuntu-22.04
120120
steps:
121-
- uses: actions/checkout@v3
121+
- uses: actions/checkout@v4
122122
with:
123123
repository: datavisyn/github-workflows
124124
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-push-docker.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
runs-on: ubuntu-22.04
3939
steps:
4040
# checkout specific source repository
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
# checkout this workflow repository to get actions
43-
- uses: actions/checkout@v3
43+
- uses: actions/checkout@v4
4444
with:
4545
repository: datavisyn/github-workflows
4646
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-push-helm-chart.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
runs-on: ubuntu-22.04
3737
steps:
3838
# checkout specific source repository
39-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
4040
# checkout this workflow repository to get actions
41-
- uses: actions/checkout@v3
41+
- uses: actions/checkout@v4
4242
with:
4343
repository: datavisyn/github-workflows
4444
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
runs-on: ubuntu-22.04
3838
steps:
3939
# checkout specific source repository
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
with:
4242
ref: ${{ inputs.branch }}
4343
# checkout this workflow repository to get actions
44-
- uses: actions/checkout@v3
44+
- uses: actions/checkout@v4
4545
with:
4646
repository: datavisyn/github-workflows
4747
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-single-product-part.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ jobs:
5959
runs-on: ubuntu-22.04
6060
steps:
6161
# checkout specific repository
62-
- uses: actions/checkout@v3
62+
- uses: actions/checkout@v4
6363
with:
6464
token: ${{ secrets.CHECKOUT_TOKEN || github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
6565
# checkout this workflow repository to get actions
66-
- uses: actions/checkout@v3
66+
- uses: actions/checkout@v4
6767
with:
6868
repository: datavisyn/github-workflows
6969
ref: ${{ env.WORKFLOW_BRANCH }}

.github/workflows/build-workspace-product-part.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ jobs:
5757
runs-on: ubuntu-22.04
5858
steps:
5959
# checkout specific repository
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
with:
6262
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
6363
# checkout this workflow repository to get actions
64-
- uses: actions/checkout@v3
64+
- uses: actions/checkout@v4
6565
with:
6666
repository: datavisyn/github-workflows
6767
ref: ${{ env.WORKFLOW_BRANCH }}

0 commit comments

Comments
 (0)