Skip to content

Commit

Permalink
Ny workflow for å bygge artifakter i main
Browse files Browse the repository at this point in the history
  • Loading branch information
torhakon committed Dec 23, 2024
1 parent 5b00e52 commit 59bae86
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/actions/authenticateNode/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Authenticate Node"
description: "Suthenticate with github node npm"
runs:
using: "composite"
steps:
- name: "Authenticate to npm"
uses: actions/setup-node@v4
with:
registry-url: "https://npm.pkg.github.com"
14 changes: 14 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Build artifact"
description: "Build artifact(s) of your packages in the current project"
inputs:
devhub:
description: "Username or alias of the Dev Hub org."
default: "devhub"
required: true
runs:
using: composite
steps:
- name: "Build package"
shell: bash
run: |
sfp build --devhubalias ${{ inputs.devhub }} --diffcheck --buildnumber ${GITHUB_RUN_ID} --branch ${GITHUB_REF#refs/heads/}
2 changes: 0 additions & 2 deletions .github/actions/ciValidate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ inputs:
runs:
using: composite
steps:
- uses: actions/checkout@v4

- name: validate
shell: bash
run: |
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/ciMainBuildAndPublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "MAIN - Build and Publish"
on:
workflow_run:
workflows: ["ciStaticCodeValidation"]
branches:
- "main"
jobs:
buildAndPublish:
runs-on: ubuntu-latest
container: ghcr.io/flxbl-io/sfp:latest
permissions:
contents: write
packages: write
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: navikt/sf-platform/.github/actions/authenticateNode@main

- uses: navikt/sf-platform/.github/actions/authenticateOrg@main
with:
auth-url: ${{ secrets.SF_DEVHUB_URL }}
alias: "devhub"
setDefaultDevhubUsername: "true"

- uses: navikt/sf-platform/.github/actions/ciValidate@main
with:
devhub: "devhub"
pools: "ci"

- uses: navikt/sf-platform/.github/actions/ciQuickBuild@main

- uses: navikt/sf-platform/.github/actions/build@main

- uses: navikt/sf-platform/.github/actions/uploadWorkflowArtifactsAndLogs@main
with:
artifactName: "build-artifacts"
uploadArtifacts: true
logName: "build-logs"
publishLogs: true

0 comments on commit 59bae86

Please sign in to comment.