diff --git a/.github/workflows/build-deploy-on-release.yaml b/.github/workflows/build-deploy-on-release.yaml new file mode 100644 index 0000000..5eaa635 --- /dev/null +++ b/.github/workflows/build-deploy-on-release.yaml @@ -0,0 +1,26 @@ +name: Deploy release + +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-digifeeds: + needs: build-production + name: Deploy to production - digifeeds + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.release.tag_name }} + file: environments/digifeeds/production/app-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml new file mode 100644 index 0000000..f579372 --- /dev/null +++ b/.github/workflows/build-main.yml @@ -0,0 +1,28 @@ +name: Docker Build Main and Deploy to Workshop + +on: + workflow_run: + workflows: [ 'Run Tests' ] + branches: [ main ] + types: [ completed ] + +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-workshop-digifeeds: + needs: build-unstable + name: "Deploy to workshop - digifeeds" + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: environments/digifeeds/workshop/app-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/build-unstable.yaml b/.github/workflows/build-unstable.yaml new file mode 100644 index 0000000..00f1c08 --- /dev/null +++ b/.github/workflows/build-unstable.yaml @@ -0,0 +1,17 @@ +name: Build unstable image + +on: + workflow_dispatch: + inputs: + tag: + description: tag + required: true + +jobs: + build-unstable: + 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 \ No newline at end of file diff --git a/.github/workflows/manual-deploy-production.yaml b/.github/workflows/manual-deploy-production.yaml new file mode 100644 index 0000000..326b2f1 --- /dev/null +++ b/.github/workflows/manual-deploy-production.yaml @@ -0,0 +1,29 @@ +name: Manual Deploy to Production + +on: + workflow_dispatch: + inputs: + tag: + description: tag + required: true + + +jobs: + build-production: + 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-digifeeds: + needs: build-production + name: Deploy to production - digifeeds + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ghcr.io/mlibrary/${{ vars.IMAGE_NAME }}:${{ github.event.inputs.tag }} + file: environments/digifeeds/production/app-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit diff --git a/.github/workflows/manual-deploy-workshop.yaml b/.github/workflows/manual-deploy-workshop.yaml index 87ab9c3..e8bec02 100644 --- a/.github/workflows/manual-deploy-workshop.yaml +++ b/.github/workflows/manual-deploy-workshop.yaml @@ -8,7 +8,21 @@ on: required: true jobs: - echo: - runs-on: ubuntu-latest - steps: - - run: echo "${{ github.event.inputs.tag }}" + build-unstable: + 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-workshop-digifeeds: + needs: build-unstable + name: Deploy to workshop - digifeeds + uses: mlibrary/platform-engineering-workflows/.github/workflows/deploy.yml@v1 + with: + image: ${{ needs.build-unstable.outputs.image }} + file: environments/digifeeds/workshop/app-image.txt + CONFIG_REPO_RW_APP_ID: ${{ vars.CONFIG_REPO_RW_APP_ID }} + CONFIG_REPO_FULL_NAME: ${{ vars.CONFIG_REPO_FULL_NAME }} + secrets: inherit