This is a repository for GitHub actions workflows for teamesyfo
Builds 1 app per environment. Supports deploying demo-prefixed branches to their own ingress.
Detailed instructions
Add a new github workflow `deploy-app.yaml` with the following:name: Build & Deploy
on: push
jobs:
next-app:
uses: navikt/teamesyfo-github-actions-workflows/.github/workflows/next-app.yaml@main
secrets: inherit
with:
app: REPLACE_ME
base-path: REPLACE_ME
Add the secondary demo-delete.yaml
with the following:
name: Demo delete
on: delete
jobs:
branch-delete:
uses: navikt/teamesyfo-github-actions-workflows/.github/workflows/next-app-demo-delete.yaml@main
secrets: inherit
with:
app: REPLACE_ME
base-path: REPLACE_ME
This reusable workflows make the following assumptions:
-
There is a
Dockerfile
on rootThis dockerfile NEEDS to accept the argument
ENV
(ARG ENV
) and copy the following:COPY nais/envs/.env.$ENV /app/.env.production
-
The naiserator files must be in the
nais
folder, namednais-dev.yaml
,nais-demo.yaml
andnais-prod.yaml
.The
nais.demo.yaml
needs to be parameterized with the following:apiVersion: 'nais.io/v1alpha1' kind: 'Application' metadata: name: {{appname}}-demo namespace: team-esyfo labels: team: team-esyfo branchState: {{branchState}} spec: image: {{image}} port: 3000 ingresses: - {{ingress}} replicas: min: {{replicas}} max: {{replicas}}
This is to support deploying branches to their own ingress.
-
There needs to be a
nais/envs
folder with the following files:.env.dev
,.env.demo
,.env.prod
. These envs will be available both during build and runtime.Note: Normal runtime-only (e.g. backend-only) envs can still be added in the nais.yaml.
Detailed instructions
name: Build & Deploy
on: push
jobs:
jar-app:
uses: navikt/teamesyfo-github-actions-workflows/.github/workflows/jar-app.yaml@main
secrets: inherit
with:
app: REPLACE_ME
This project is maintained by navikt/team-esyfo
If you work in @navikt you can reach us at the Slack channel #esyfo