Skip to content

Flowforge - build and deploy #1318

Flowforge - build and deploy

Flowforge - build and deploy #1318

name: Flowforge - build and deploy
on:
workflow_dispatch:
inputs:
flowforge_release_name:
description: 'flowforge package version'
required: false
default: 'nightly'
flowforge_ref:
description: 'flowforge package ref'
required: false
push:
branches:
- main
paths-ignore:
- 'helm/**'
- '.github/workflows/helm*'
pull_request:
branches:
- main
paths-ignore:
- 'helm/**'
- '.github/workflows/helm*'
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
name: Build single-architecture container images
uses: flowfuse/github-actions-workflows/.github/workflows/[email protected]
with:
image_name: 'forge-k8s'
package_dependencies: |
@flowfuse/flowfuse
@flowfuse/driver-kubernetes
build_context: 'flowforge-container'
npm_registry_url: ${{ vars.PUBLIC_NPM_REGISTRY_URL }}
scan_image: true
secrets:
npm_registry_auth_token: ${{ secrets.NPM_PUBLISH_TOKEN }}
temporary_registry_token: ${{ secrets.GITHUB_TOKEN }}
build-multi-architecture:
name: Build multi-architecture container image
needs: build
uses: flowfuse/github-actions-workflows/.github/workflows/[email protected]
with:
image_name: 'forge-k8s'
secrets:
temporary_registry_token: ${{ secrets.GITHUB_TOKEN }}
deploy-stage:
if: github.ref_name == 'main'
name: Deploy to staging environment
needs: build-multi-architecture
uses: flowfuse/github-actions-workflows/.github/workflows/[email protected]
with:
environment: stage
service_name: 'forge-k8s'
deployment_name: flowforge
container_name: forge
image: ${{ needs.build-multi-architecture.outputs.image }}
secrets:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
temporary_registry_token: ${{ secrets.GITHUB_TOKEN }}
eks_cluster_name: ${{ secrets.EKS_CLUSTER_NAME }}
deploy-prod:
if: github.ref_name == 'main'
name: Deploy to production environment
needs: [build-multi-architecture, deploy-stage]
uses: flowfuse/github-actions-workflows/.github/workflows/[email protected]
with:
environment: production
service_name: 'forge-k8s'
deployment_name: flowforge
container_name: forge
image: ${{ needs.build-multi-architecture.outputs.image }}
secrets:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_ACCESS_KEY_SECRET }}
temporary_registry_token: ${{ secrets.GITHUB_TOKEN }}
eks_cluster_name: ${{ secrets.EKS_CLUSTER_NAME }}