Skip to content

Commit

Permalink
Merge pull request #205 from mlibrary/main
Browse files Browse the repository at this point in the history
Adding platform engineering workflows.
  • Loading branch information
bertrama authored Dec 10, 2024
2 parents 1013c24 + 6f1ab3b commit 55192a0
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-deploy-on-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build and Deploy Production

on:
release:
types: [ released ]

jobs:
build-production:
name: Build production ${{ github.event.release.tag_name }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/build-production.yml@v1
with:
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.event.release.tag_name }}
dockerfile: Dockerfile
secrets: inherit


deploy-production:
needs: build-production
name: Deploy to production
uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1
with:
image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }}
file: ${{ vars.CONFIG_REPO_PRODUCTION_IMAGE_FILE }}
CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }}
CONFIG_REPO_RW_INSTALL_ID: ${{ vars.CONFIG_REPO_RW_INSTALL_ID }}
CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }}
secrets: inherit
28 changes: 28 additions & 0 deletions .github/workflows/build-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build web on push to main

on:
push:
branches:
- main

jobs:
build-unstable:
name: Build unstable ${{ github.sha }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/build-unstable.yml@v1
with:
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.sha }}
dockerfile: Dockerfile
secrets: inherit

deploy-testing:
needs: build-unstable
name: Deploy to testing
uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1
with:
image: ${{ needs.build-unstable.outputs.image }}
file: ${{ vars.CONFIG_REPO_TESTING_IMAGE_FILE }}
CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }}
CONFIG_REPO_RW_INSTALL_ID: ${{ vars.CONFIG_REPO_RW_INSTALL_ID }}
CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }}
secrets: inherit
31 changes: 31 additions & 0 deletions .github/workflows/manual-deploy-production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Manual deploy production

on:
workflow_dispatch:
inputs:
tag:
description: Release
required: true


jobs:
build-production:
name: Build production ${{ github.event.inputs.tag }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/build-production.yml@v1
with:
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.event.inputs.tag }}
dockerfile: Dockerfile
secrets: inherit

deploy-production:
needs: build-production
name: Deploy to production
uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1
with:
image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.inputs.tag }}
file: ${{ vars.CONFIG_REPO_PRODUCTION_IMAGE_FILE }}
CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }}
CONFIG_REPO_RW_INSTALL_ID: ${{ vars.CONFIG_REPO_RW_INSTALL_ID }}
CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }}
secrets: inherit
30 changes: 30 additions & 0 deletions .github/workflows/manual-deploy-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Manual deploy workshop

on:
workflow_dispatch:
inputs:
tag:
description: tag
required: true

jobs:
build-unstable:
name: Build unstable ${{ github.event.inputs.tag }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/build-unstable.yml@v1
with:
image_name: ${{ vars.IMAGE_NAME }}
tag: ${{ github.event.inputs.tag }}
dockerfile: Dockerfile
secrets: inherit

deploy:
needs: build-unstable
name: Deploy to ${{ github.event.inputs.tanka_env }}
uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1
with:
image: ${{ needs.build-unstable.outputs.image }}
file: ${{ vars.CONFIG_REPO_TESTING_IMAGE_FILE }}
CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }}
CONFIG_REPO_RW_INSTALL_ID: ${{ vars.CONFIG_REPO_RW_INSTALL_ID }}
CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }}
secrets: inherit

0 comments on commit 55192a0

Please sign in to comment.