-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (52 loc) · 1.64 KB
/
common.workflow.libs.frontend.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
on:
workflow_call:
inputs:
working-directory:
type: string
description: "The working directory for the job, e.g. libs/commands (without leading/trailing slash)."
required: true
secrets:
READER_TOKEN:
required: true
jobs:
start:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- name: "Logging"
run: |
echo "branch: ${{ github.ref }}"
echo "inputs: ${{ toJSON(inputs) }}"
echo "env: ${{ toJSON(env) }}"
echo "commit: ${{ github.event.head.commit_message }}"
build:
needs: start
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setup"
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://npm.pkg.github.com/
scope: "@navikt"
- name: "Install"
run: npm install
working-directory: ${{ inputs.working-directory }}
env:
NODE_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
- name: "Build"
run: npm run build
working-directory: ${{ inputs.working-directory }}
- name: "Publish"
if: |
(github.ref == 'refs/heads/master' || contains(github.event.head_commit.message, '#publish-libs')) &&
(!contains(github.event.head_commit.message, '[skip ci]'))
run: npm version patch && npm publish
working-directory: ${{ inputs.working-directory }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}