Skip to content

KAlenderavtale støtter AVHOLDT #71

KAlenderavtale støtter AVHOLDT

KAlenderavtale støtter AVHOLDT #71

name: "Widget: build and publish"
on:
push:
paths:
- 'widget/**'
- 'app/src/main/resources/bruker.graphql'
workflow_dispatch:
jobs:
component:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
cache-dependency-path: widget/component/package-lock.json
- name: install dependencies
run: |
cd widget/component
npm ci
- name: build
run: |
cd widget/component
npm run build
- name: test
run: |
cd widget/component
npm test
- if: github.ref == 'refs/heads/main'
name: publish
run: |
cd widget/component
if jq --null-input --exit-status \
--argjson local "$(jq .version package.json)" \
--argjson published "$(npm view --json @navikt/arbeidsgiver-notifikasjon-widget versions)" \
'$published | map(. == $local) | any'
then
echo "Version already published. Nothing to do."
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://npm.pkg.github.com'
- if: github.ref == 'refs/heads/main'
name: publish on github
run: |
cd widget/component
if jq --null-input --exit-status \
--argjson local "$(jq .version package.json)" \
--argjson published "$(npm view --json @navikt/arbeidsgiver-notifikasjon-widget versions)" \
'$published | map(. == $local) | any'
then
echo "Version already published. Nothing to do."
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
brukerapi-mock:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: build
run: |
cd widget/brukerapi-mock
npm run build
- if: github.ref == 'refs/heads/main'
name: publish
run: |
cd widget/brukerapi-mock
if jq --null-input --exit-status \
--argjson local "$(jq .version package.json)" \
--argjson published "$(npm view --json @navikt/arbeidsgiver-notifikasjoner-brukerapi-mock versions)" \
'$published | map(. == $local) | any'
then
echo "Version already published. Nothing to do."
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://npm.pkg.github.com'
- if: github.ref == 'refs/heads/main'
name: publish on github
run: |
cd widget/brukerapi-mock
if jq --null-input --exit-status \
--argjson local "$(jq .version package.json)" \
--argjson published "$(npm view --json @navikt/arbeidsgiver-notifikasjoner-brukerapi-mock versions)" \
'$published | map(. == $local) | any'
then
echo "Version already published. Nothing to do."
else
npm publish --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}