generated from navikt/tms-microfrontend-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use workflow from common workflow repo (#70)
- Loading branch information
Showing
1 changed file
with
7 additions
and
66 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,16 @@ | ||
name: "Build and deploy" | ||
name: Build & Deploy | ||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
name: "build" | ||
runs-on: "ubuntu-latest" | ||
outputs: | ||
cdn_url: ${{ steps.extract-manifest-url.outputs.url }} | ||
image: ${{ steps.docker-build-push.outputs.image }} | ||
|
||
vite-mikrofrontend: | ||
uses: navikt/teamesyfo-github-actions-workflows/.github/workflows/vite-mikrofrontend.yaml@main | ||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
packages: "write" | ||
|
||
steps: | ||
- uses: "actions/checkout@v4" | ||
- uses: "actions/setup-node@v4" | ||
with: | ||
node-version: 16 | ||
registry-url: "https://npm.pkg.github.com" | ||
cache: "npm" | ||
- name: "Install dependencies" | ||
run: "npm ci" | ||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }} | ||
- name: "Run Cypress tests" | ||
run: "npx cypress run --component" | ||
- name: "Build application" | ||
run: "npm run build" | ||
|
||
- name: cdn-upload | ||
id: cdn-upload | ||
uses: navikt/frontend/actions/cdn-upload/v1@main | ||
with: | ||
cdn-team-name: team-esyfo | ||
source: ./dist/ | ||
destination: "dialogmote-mikrofrontend" | ||
|
||
- name: Extract manifest url | ||
id: extract-manifest-url | ||
run: | | ||
files="${{ steps.cdn-upload.outputs.uploaded }}" | ||
first_file=$(echo $files | cut -d',' -f1) | ||
echo "url=https://cdn.nav.no/$first_file" >> $GITHUB_OUTPUT | ||
- name: Build and push docker image | ||
uses: nais/docker-build-push@v0 | ||
id: docker-build-push | ||
with: | ||
team: team-esyfo | ||
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }} | ||
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }} | ||
|
||
update-manifest-dev: | ||
needs: "build" | ||
uses: navikt/tms-deploy/.github/workflows/oppdater-mikrofrontend-manifest.yaml@main | ||
with: | ||
cluster: dev-gcp | ||
id: syfo-dialog | ||
url: ${{needs.build.outputs.cdn_url}} | ||
contents: read | ||
id-token: write | ||
packages: write | ||
secrets: inherit | ||
|
||
update-manifest-prod: | ||
if: github.ref == 'refs/heads/main' | ||
needs: "build" | ||
uses: navikt/tms-deploy/.github/workflows/oppdater-mikrofrontend-manifest.yaml@main | ||
with: | ||
cluster: prod-gcp | ||
app: dialogmote-mikrofrontend | ||
id: syfo-dialog | ||
url: ${{needs.build.outputs.cdn_url}} | ||
secrets: inherit |