TEN-538: Abort call to Oversikt in JournalFoering when going to page … #1016
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build npm and deploy Maven-artifact. See the step 'Deploy Maven artifact...' for Maven dependency/version" | |
permissions: | |
deployments: write | |
packages: write | |
contents: write | |
on: | |
push: | |
branches: | |
- '*' | |
- '*/*' | |
jobs: | |
tag_build_and_deploy: | |
name: 'Build' | |
runs-on: ubuntu-latest | |
env: | |
application: "eux-web-app" | |
strategy: | |
matrix: | |
node-version: [16.x] | |
steps: | |
# PULL REPOSITORY | |
- name: 'Pull repository' | |
uses: actions/checkout@v1 | |
# CACHE NODE | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: ./node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('package.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }} | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# CACHE MAVEN | |
- name: Cache maven plugin dependencies | |
uses: actions/cache@v1 | |
env: | |
cache-name: cache-mvn-plugin | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('settings.xml') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }} | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# SETUP NODE | |
- name: 'Setup Node' | |
uses: actions/setup-node@v2.1.2 | |
with: | |
node-version: 16.x | |
registry-url: https://npm.pkg.github.com/ | |
scope: "@navikt" | |
# INSTALL NPM DEPENDENCIES | |
- name: 'Install NPM dependencies' | |
run: | | |
application="eux-web-app" | |
npm install --force | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | |
# BUILD NPM | |
- name: 'Build npm' | |
run: | | |
RAW_SEMVER=`node -pe "require('./package.json').version"` | |
SEMVER=`echo -e "${RAW_SEMVER}" | tr -d '[:space:]'` | |
echo "semver=${SEMVER}" | |
echo "SEMVER=$SEMVER" >> $GITHUB_ENV | |
echo "npm run build" | |
npm run build | |
# ZIP FRONTEND | |
- name: 'Zip the frontend' | |
run: | | |
echo "copying content" | |
frontendDir="${GITHUB_WORKSPACE}/eux-web-app" | |
echo $frontendDir | |
mkdir -p $frontendDir | |
rm -rf $frontendDir/* | |
cp -r build/* $frontendDir | |
buildVersion="${SEMVER}-${GITHUB_RUN_ID}" | |
echo "buildVersion=${buildVersion}" | |
zipFile="${application}-${buildVersion}.zip" | |
cd build | |
zip -r ${zipFile} * | |
cd .. | |
mv build/${zipFile} ./${zipFile} | |
major=${SEMVER%%.*} | |
minor=${SEMVER/major./} | |
minor=${minor%%.*} | |
qualifier="${GITHUB_RUN_ID}" | |
version="${major}.${minor}-${qualifier}" | |
versionZipfile="${application}-${version}.zip" | |
echo "versionZipfile=${versionZipfile}" | |
mv ${zipFile} ${versionZipfile} | |
echo "version=$version" >> $GITHUB_ENV | |
echo "versionZipfile=$versionZipfile" >> $GITHUB_ENV | |
# DEPLOY MAVEN ARTIFACT | |
- name: "Deploy Maven artifact to NAV IKT's GitHub Package Registry" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo "<dependency>" | |
echo " <groupId>no.nav.eux</groupId>" | |
echo " <artifactId>${application}</artifactId>" | |
echo " <version>${version}</version>" | |
echo "</dependency>" | |
mvn --settings settings.xml deploy:deploy-file -Dfile=${versionZipfile} -DartifactId=${application} -DgroupId=no.nav.eux -Dversion=${version} -Ddescription='Eux-web-app JavaScript resources.' -Durl=https://maven.pkg.github.com/navikt/eux-web-app -DrepositoryId=github | |
- name: 'Echo Version' | |
run: | | |
echo "## Version:" >> $GITHUB_STEP_SUMMARY | |
echo "${version}" >> $GITHUB_STEP_SUMMARY |