Skip to content

Commit

Permalink
Add IONOS Deploy Now workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ionos-deploy-now[bot] authored Sep 16, 2024
1 parent 0025f47 commit a435522
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/rsv-dossier-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# To better understand this file read this:
# https://docs.ionos.space/docs/github-actions-customization/

name: "Deploy Now: Execute Build"

on:
workflow_call:
inputs:
site-url:
required: true
type: string
branch-id:
required: true
type: string

env:
DEPLOYMENT_FOLDER: dist

jobs:
# Please do not rename this job
build-project:
name: build rsv-dossier
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: v22.x

- name: Build Node assets
env:
CI: true
SITE_URL: ${{ inputs.site-url }}
run: |
npm ci
npm run build
# Please do not touch the following action
- name: Store deployment content
uses: ionos-deploy-now/artifact-action@v1
with:
api-key: ${{ secrets.IONOS_API_KEY }}
service-host: api-eu.ionos.space
project-id: 2e71e7e5-7fd8-4038-ac6c-0492f3218c92
branch-id: ${{ inputs.branch-id }}
version: ${{ github.sha }}
folder: ${{ env.DEPLOYMENT_FOLDER }}
config-file: .deploy-now/rsv-dossier/config.yaml
action: upload
55 changes: 55 additions & 0 deletions .github/workflows/rsv-dossier-orchestration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Please do not edit this file.
# Build steps can be customized in the rsv-dossier-build.yaml.
# More information under https://docs.ionos.space/docs/github-actions-customization/
# version: 2022-07-21

name: "Deploy Now: Orchestration"
run-name: "Deploy Now: Build rsv-dossier · ${{ github.event.head_commit.message || format('Triggered by {0}', github.triggering_actor) }}"

on:
- push
- workflow_dispatch

jobs:
retrieve-project:
name: check readiness
runs-on: ubuntu-latest
outputs:
deployment-enabled: ${{ fromJson(steps.project.outputs.info).deployment-enabled }}
branch-id: ${{ fromJson(steps.project.outputs.info).branch-id }}
steps:
- name: Fetch project data
uses: ionos-deploy-now/project-action@v1
id: project
with:
api-key: ${{ secrets.IONOS_API_KEY }}
service-host: api-eu.ionos.space
project-id: 2e71e7e5-7fd8-4038-ac6c-0492f3218c92
action: retrieve-info


build:
name: build
needs: retrieve-project
if: ${{ needs.retrieve-project.outputs.deployment-enabled == 'true' }}
uses: ./.github/workflows/rsv-dossier-build.yaml
with:
site-url: https://IONOS_DEPLOY_NOW_SITE_URL
branch-id: ${{ needs.retrieve-project.outputs.branch-id }}
secrets: inherit

deploy:
name: trigger deployment
needs:
- retrieve-project
- build
runs-on: ubuntu-latest
steps:
- name: Dispatch deployment(s)
uses: ionos-deploy-now/project-action@v1
with:
api-key: ${{ secrets.IONOS_API_KEY }}
service-host: api-eu.ionos.space
project-id: 2e71e7e5-7fd8-4038-ac6c-0492f3218c92
branch-id: ${{ needs.retrieve-project.outputs.branch-id }}
action: dispatch-deployments

0 comments on commit a435522

Please sign in to comment.