Skip to content

rannveigskjerve/teamesyfo-github-actions-workflows

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

teamesyfo-github-actions-workflows

This is a repository for GitHub actions workflows for teamesyfo

🚀 Usage

Deploying a Next application (next-app.yaml)

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

Important:

This reusable workflows make the following assumptions:

  1. There is a Dockerfile on root

    This dockerfile NEEDS to accept the argument ENV (ARG ENV) and copy the following: COPY nais/envs/.env.$ENV /app/.env.production

  2. The naiserator files must be in the nais folder, named nais-dev.yaml, nais-demo.yaml and nais-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.

  3. 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.

Deploying a Ktor or Spring Boot application (jar-app.yaml)

Detailed instructions

1. Add a new github workflow deploy-app.yaml with the following:

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

2. The naiserator files must be in the nais folder, named nais-dev.yaml and nais-prod.yaml.

👥 Contact

This project is maintained by navikt/team-esyfo

If you work in @navikt you can reach us at the Slack channel #esyfo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published