Skip to content

Commit 59bb101

Browse files
Merge pull request #39 from datavisyn/new_deployment_no_ports
New deployment no ports
2 parents 692621c + 2f3f3e2 commit 59bb101

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
@@ -56,6 +56,11 @@ on:
5656
type: string
5757
required: false
5858
default: "ubuntu-22.04-large"
59+
#disable_cache:
60+
# description: "Set to true to disable caching"
61+
# required: false
62+
# type: boolean
63+
# default: false
5964
secrets:
6065
DATAVISYN_BOT_REPO_TOKEN:
6166
required: false
@@ -74,7 +79,8 @@ env:
7479
PYPI_REGISTRY: "https://upload.pypi.org/legacy/"
7580
PYPI_USERNAME: "datavisyn"
7681
PYTHON_VERSION: "3.10"
77-
WORKFLOW_BRANCH: "new_deployment"
82+
WORKFLOW_BRANCH: "new_deployment_no_ports"
83+
POSTGRES_HOSTNAME: postgres_${{ inputs.branch }}_${{ github.run_id }}
7884

7985
permissions:
8086
contents: read
@@ -93,12 +99,12 @@ jobs:
9399
runs-on: ${{ inputs.runs_on }}
94100
steps:
95101
- name: Checkout source repository
96-
uses: actions/checkout@v3
102+
uses: actions/checkout@v4
97103
with:
98104
ref: ${{ inputs.branch }}
99105
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
100106
- name: Checkout github-workflows
101-
uses: actions/checkout@v3
107+
uses: actions/checkout@v4
102108
with:
103109
repository: datavisyn/github-workflows
104110
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -110,6 +116,7 @@ jobs:
110116
npm_registry: ${{ env.NPM_REGISTRY }}
111117
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
112118
run_webpack: ${{ inputs.node_run_webpack }}
119+
#disable_cache: ${{ inputs.disable_cache }}
113120

114121
build-python:
115122
name: Python
@@ -120,12 +127,12 @@ jobs:
120127
runs-on: ${{ inputs.runs_on }}
121128
steps:
122129
- name: Checkout source repository
123-
uses: actions/checkout@v3
130+
uses: actions/checkout@v4
124131
with:
125132
ref: ${{ inputs.branch }}
126133
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
127134
- name: Checkout github-workflows
128-
uses: actions/checkout@v3
135+
uses: actions/checkout@v4
129136
with:
130137
repository: datavisyn/github-workflows
131138
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -135,7 +142,7 @@ jobs:
135142
with:
136143
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
137144
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
138-
145+
#disable_cache: ${{ inputs.disable_cache }}
139146
# If cypress is used, build node and python sequentially as it is avoiding the duplicate install overhead
140147
build-node-python-cypress:
141148
name: Node, Python, Cypress
@@ -160,17 +167,21 @@ jobs:
160167
--health-interval 10s
161168
--health-timeout 5s
162169
--health-retries 5
163-
ports:
164-
- 5432:5432
170+
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
165171
166172
steps:
173+
- name: Set system env variable to github env
174+
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
175+
- name: Connect service to default network
176+
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
177+
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
167178
- name: Checkout source repository
168-
uses: actions/checkout@v3
179+
uses: actions/checkout@v4
169180
with:
170181
ref: ${{ inputs.branch }}
171182
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
172183
- name: Checkout github-workflows
173-
uses: actions/checkout@v3
184+
uses: actions/checkout@v4
174185
with:
175186
repository: datavisyn/github-workflows
176187
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -182,11 +193,13 @@ jobs:
182193
npm_registry: ${{ env.NPM_REGISTRY }}
183194
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
184195
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
196+
#disable_cache: ${{ inputs.disable_cache }}
185197
- name: Build python
186198
uses: ./tmp/github-workflows/.github/actions/build-python
187199
with:
188200
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
189201
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
202+
#disable_cache: ${{ inputs.disable_cache }}
190203
- name: Decrypt .env.enc and <app>/.env.enc
191204
run: |
192205
yarn run env:decrypt -pass env:ENV_PASSWORD || true
@@ -209,6 +222,8 @@ jobs:
209222
make start
210223
wait-on: "http://localhost:8080, http://localhost:9000/health"
211224
env: ${{ secrets.CYPRESS_ENV }}
225+
env:
226+
POSTGRES_HOSTNAME: ${{ env.POSTGRES_HOSTNAME }}
212227
- name: Run cypress component tests
213228
uses: cypress-io/github-action@v6
214229
with:
@@ -256,17 +271,21 @@ jobs:
256271
--health-interval 10s
257272
--health-timeout 5s
258273
--health-retries 5
259-
ports:
260-
- 5432:5432
274+
--name postgres_${{ inputs.branch }}_${{ github.run_id }}
261275
262276
steps:
277+
- name: Set system env variable to github env
278+
run: echo "GH_ACTIONS_SELF_HOSTED_NETWORK_NAME=${GH_ACTIONS_SELF_HOSTED_NETWORK_NAME}" >> "$GITHUB_ENV"
279+
- name: Connect service to default network
280+
if: env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME != ''
281+
run: docker network connect ${{ env.GH_ACTIONS_SELF_HOSTED_NETWORK_NAME }} ${{ env.POSTGRES_HOSTNAME }}
263282
- name: Checkout source repository
264-
uses: actions/checkout@v3
283+
uses: actions/checkout@v4
265284
with:
266285
ref: ${{ inputs.branch }}
267286
token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
268287
- name: Checkout github-workflows
269-
uses: actions/checkout@v3
288+
uses: actions/checkout@v4
270289
with:
271290
repository: datavisyn/github-workflows
272291
ref: ${{ env.WORKFLOW_BRANCH }}
@@ -278,11 +297,13 @@ jobs:
278297
npm_registry: ${{ env.NPM_REGISTRY }}
279298
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
280299
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
300+
#disable_cache: ${{ inputs.disable_cache }}
281301
- name: Build python
282302
uses: ./tmp/github-workflows/.github/actions/build-python
283303
with:
284304
python_version: ${{ secrets.PYTHON_VERSION || env.PYTHON_VERSION }}
285305
github_ro_token: ${{ github.event.repository.private == true && secrets.DATAVISYN_BOT_REPO_TOKEN || github.token }}
306+
#disable_cache: ${{ inputs.disable_cache }}
286307
- name: Decrypt .env.enc and <app>/.env.enc
287308
run: |
288309
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)