Skip to content

andyjmaclean is deploying develop to test #20

andyjmaclean is deploying develop to test

andyjmaclean is deploying develop to test #20

Workflow file for this run

name: Build / Deployment
run-name: ${{ github.actor }} is ${{ github.event.inputs.run_build == 'true' && 'building and deploying' || 'deploying' }} ${{ github.event.inputs.tag_name }} to ${{ github.event.inputs.deploy_environment }}
on:
workflow_dispatch:
inputs:
deploy_environment:
description: 'target environment'
required: true
default: 'test'
type: choice
options:
- test
- acceptance
- production
tag_name:
description: 'branch or tag to deploy'
default: 'develop'
type: string
run_build:
description: '(re)build docker image'
default: false
type: boolean
jobs:
make-env-file:
uses: ./.github/workflows/env-file-generation.yaml
with:
deploy_environment: ${{ github.event.inputs.deploy_environment }}
secrets: inherit
run-tests:
if: ${{ github.event.inputs.run_build == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name }}
- uses: actions/setup-node@v4
with:
node-version: '18.18.0'
- run: npm install
- run: npm run test:dev
- run: cp coverage/**/lcov.info .
- uses: actions/upload-artifact@master
with:
name: appSource
path: src/app
- uses: actions/upload-artifact@master
with:
name: appLcov
path: ./lcov.info
run-sonar:
if: ${{ github.event.inputs.run_build == 'true' }}
needs: [run-tests]
runs-on: ubuntu-latest
steps:
- name: Get Project Source
uses: actions/download-artifact@master
with:
name: appSource
path: src/app
- name: Get Project LCOV
uses: actions/download-artifact@master
with:
name: appLcov
path: ./lcov.info
- name: SonarQube Scan
uses: sonarsource/sonarcloud-github-action@master
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args:
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=europeana
-Dsonar.projectKey=europeana_statistics-dashboard
-Dsonar.test.inclusions=**/*.spec.ts
-Dsonar.sources=src/app
-Dsonar.exclusions=src/**/_mocked/**
-Dsonar.javascript.lcov.reportPaths=./lcov.info/lcov.info
build-dist:
if: ${{ github.event.inputs.run_build == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name }}
- name: Build Artifact
uses: actions/setup-node@v4
with:
node-version: '18.18.0'
- run: npm install
- run: npm run dist-localised
#- run: mkdir tmp-dir && mv dist tmp-dir/ && mv tmp-dir dist
- uses: actions/upload-artifact@master
with:
name: dist
path: ./dist
push-docker-image:
if: ${{ github.event.inputs.run_build == 'false' || !contains(needs.*.result, 'failure') }}
needs: [build-dist, run-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag_name }}
- name: Get Built Artifact
uses: actions/download-artifact@master
with:
name: dist
path: ./dist
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3
- name: Extract Metadata for Docker Image
id: meta
uses: docker/metadata-action@v5
env:
PROJECT_VERSION: ${{ secrets.PROJECT_VERSION }}
with:
images: europeana/statistics-dashboard
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
type=raw,value=latest,enable={{is_default_branch}}
europeana/statistics-dashboard-ui:${{ env.PROJECT_VERSION }}
europeana/statistics-dashboard-ui:${{ github.event.inputs.tag_name || 'develop' }}
${{ github.event.inputs.tag_name || 'develop' }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push-to-kubernetes:
if: always() && !contains(needs.*.result, 'failure')
needs: [push-docker-image, make-env-file]
uses: ./.github/workflows/deploy-image.yaml

Check failure on line 158 in .github/workflows/node.js.yaml

View workflow run for this annotation

GitHub Actions / Build / Deployment

Invalid workflow file

The workflow is not valid. In .github/workflows/node.js.yaml (Line: 158, Col: 11): Error from called workflow europeana/statistics-dashboard/.github/workflows/deploy-image.yaml@6e9f829da8269705e46afa0b213b83e78c5763d8 (Line: 42, Col: 9): 'run' is already defined
secrets: inherit