Skip to content

Commit

Permalink
Use workflow from common workflow repo (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaja-nav authored Jan 22, 2024
1 parent 795bb85 commit 01d0df2
Showing 1 changed file with 7 additions and 66 deletions.
73 changes: 7 additions & 66 deletions .github/workflows/build-and-deploy.yaml
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

0 comments on commit 01d0df2

Please sign in to comment.