Skip to content

Commit

Permalink
MET-5919 Introduce Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjmaclean committed Apr 11, 2024
1 parent b8ca675 commit 51f89f9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/_deploy-metis.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
node-version: '18.18.0'
- run: npm install
- run: npm build-shared
- run: npm run build-shared
- run: npm run dist-metis
- uses: actions/upload-artifact@master
with:
Expand Down Expand Up @@ -139,4 +139,7 @@ jobs:
&& !cancelled()
needs: [push-docker-image, make-env-file]
uses: ./.github/workflows/deploy-image.yaml
with:
image_name: metis-ui
project_dir: metis
secrets: inherit
5 changes: 4 additions & 1 deletion .github/workflows/_deploy-sandbox.js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
with:
node-version: '18.18.0'
- run: npm install
- run: npm build-shared
- run: npm run build-shared
- run: npm run dist-sandbox
- uses: actions/upload-artifact@master
with:
Expand Down Expand Up @@ -140,4 +140,7 @@ jobs:
&& !cancelled()
needs: [push-docker-image, make-env-file-sandbox]
uses: ./.github/workflows/deploy-image.yaml
with:
image_name: sandbox-ui
project_dir: sandbox
secrets: inherit
23 changes: 16 additions & 7 deletions .github/workflows/deploy-image.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
name: '- helper (image deployment)'
on: workflow_call
on:
workflow_call:
inputs:
image_name:
description: 'docker image name (metis-ui or sandbox-ui)'
required: true
default: 'metis-ui'
type: string
project_dir:
description: 'project directory'
required: true
default: 'metis'
type: string
jobs:
deploy-image:
runs-on: ubuntu-latest
Expand All @@ -12,23 +24,20 @@ jobs:
with:
name: envFile
path: env_file

- run: |
mv env_file/env_file deployment/${{ github.event.inputs.deploy_environment }}
mv env_file/env_file ${{ github.event.inputs.project_dir }}/deployment/${{ github.event.inputs.deploy_environment }}
- run: |
tag=${{ github.event.inputs.tag_name || 'develop' }}
TAG_ESCAPED=${tag//[\/]/_}
echo TAG_ESCAPED=${TAG_ESCAPED} >> $GITHUB_ENV
- name: Inject Variables 1
uses: cschleiden/replace-tokens@v1
with:
tokenPrefix: '#{'
tokenSuffix: '}#'
files: '["deployment/${{ github.event.inputs.deploy_environment }}/*.yaml"]'
files: '["${{ github.event.inputs.project_dir }}/deployment/${{ github.event.inputs.deploy_environment }}/*.yaml"]'
env:
APP_IMAGE: europeana/statistics-dashboard:${{ env.TAG_ESCAPED }}
APP_IMAGE: europeana/${{ github.event.inputs.image_name }}:${{ env.TAG_ESCAPED }}
MAX_REPLICAS: '4'
MIN_REPLICAS: '2'
UTILISATION_AVERAGE_PERCENT: '75'
Expand Down

0 comments on commit 51f89f9

Please sign in to comment.