Skip to content

#418: Remove export calendar functionality from studies module #1338

#418: Remove export calendar functionality from studies module

#418: Remove export calendar functionality from studies module #1338

Workflow file for this run

name: Test, Build and Publish
on:
push:
workflow_dispatch:
inputs:
dockerTag:
description: If set, docker img is built and tagged accordingly
required: false
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository_owner }}/more-study-manager-frontend
jobs:
test:
name: "Run Tests"
runs-on: ubuntu-latest
steps:
- name: Checkout commit
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '16.x'
- name: Cache NPM
uses: actions/cache@v4
with:
path: ~/.npm
key: "${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}"
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
run: npm ci
- name: Run linting
run: npm run lint
- name: 3rd-Party Licenses
run: |
mkdir -p target/
npm --silent run license:list > target/THIRD_PARTY.txt
cat target/THIRD_PARTY.txt
- name: Upload License List
if: always()
uses: actions/upload-artifact@v4
with:
name: 3rd Party Licenses
path: "target/THIRD_PARTY.txt"
- name: Check licenses
run: npm run license:check
# - name: Run tests
# run: npm run test:unit:once
#
# - name: Upload Test Results
# if: always()
# uses: actions/upload-artifact@v4
# with:
# name: Test Results
# path: "target/testResults.xml"
- name: Run build
run: npm run package
env:
VITE_GIT_BRANCH: '${{ github.ref_name }}'
VITE_GIT_REVISION: '${{ github.sha }}'
build-and-push-image:
name: Build and Push Docker Image
runs-on: ubuntu-latest
if: contains(fromJSON('["main", "develop", "redlink"]'), github.ref_name) || github.event.inputs.dockerTag != ''
needs:
- test
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
tags: |
# tag with unique id
type=raw,value=1.0.${{ github.run_number }}.{{sha}}
# tag with branch-name
type=ref,event=branch,enable=${{ github.event.inputs.dockerTag == '' }}
# latest-tag on the default-branch (main)
type=raw,value=latest,enable={{is_default_branch}}
# a manually provided tag
type=raw,value=${{ github.event.inputs.dockerTag }}
- name: Build and push Docker image
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_GIT_BRANCH
VITE_GIT_REVISION
env:
VITE_GIT_BRANCH: '${{ github.ref_name }}'
VITE_GIT_REVISION: '${{ github.sha }}'
DOCKER_BUILD_RECORD_UPLOAD: 'false'
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v4
with:
name: Event File
path: ${{ github.event_path }}