Skip to content

Build

Build #1

Workflow file for this run

name: "Build"
on:
workflow_call:
secrets:
SF_DEVHUB_URL:
required: true
workflow_run:
workflows: ["ciQuickBuild"]
branches:
- main
workflow_dispatch:
jobs:
build:
name: "Build"
runs-on: ubuntu-latest
container: ghcr.io/flxbl-io/sfp:latest
permissions:
contents: read
packages: write
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: navikt/crm-workflows-base/.github/actions/authenticateOrg@master
with:
auth-url: ${{ secrets.SF_DEVHUB_URL }}
alias: devhub
setDefaultDevhubUsername: true
- name: "Build package"
run: |
sfp build --devhubalias devhub --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/}
- name: "Publish artifacts"
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: artifacts
- name: "Authenticate to npm"
uses: actions/setup-node@v4
with:
registry-url: "https://npm.pkg.github.com"
- name: "Publish"
run: |
sfp publish --artifactdir artifacts --npm --scope @${{ github.repository_owner }} --gittag --pushgittag
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Flxbl logs
- name: "Publish logs"
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: "logs"
path: .sfpowerscripts
if-no-files-found: ignore
retention-days: 1