diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dfbec38..f95e9ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,13 +8,18 @@ on: required: false default: teaser-2026 type: string + runner: + description: Runner label to use for the build + required: false + default: prox-1 + type: string secrets: USER_AUTH: required: true jobs: build: - runs-on: prox-1 + runs-on: ${{ inputs.runner }} steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9350e14..9bfc7a3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -2,13 +2,19 @@ name: deploy on: workflow_call: + inputs: + runner: + description: Runner label to use for the deploy + required: false + default: prox-1 + type: string secrets: USER_AUTH: required: true jobs: deploy: - runs-on: prox-1 + runs-on: ${{ inputs.runner }} steps: - name: Restart NextJS service env: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c15d82..54eb60e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,6 +4,7 @@ on: push: branches: - teaser-2026 + - development workflow_dispatch: inputs: ref: @@ -12,16 +13,42 @@ on: default: teaser-2026 type: string +env: + REF_NAME: ${{ github.event.inputs.ref || github.ref_name }} + jobs: - build: + build_teaser: + if: ${{ env.REF_NAME == 'teaser-2026' }} + uses: ./.github/workflows/build.yml + with: + ref: ${{ env.REF_NAME }} + runner: prox-1 + secrets: + USER_AUTH: ${{ secrets.USER_AUTH }} + + deploy_teaser: + if: ${{ env.REF_NAME == 'teaser-2026' }} + needs: build_teaser + uses: ./.github/workflows/deploy.yml + with: + runner: prox-1 + secrets: + USER_AUTH: ${{ secrets.USER_AUTH }} + + build_dev: + if: ${{ env.REF_NAME == 'development' }} uses: ./.github/workflows/build.yml with: - ref: ${{ github.event.inputs.ref || github.ref_name }} + ref: ${{ env.REF_NAME }} + runner: prox-2 secrets: USER_AUTH: ${{ secrets.USER_AUTH }} - deploy: - needs: build + deploy_dev: + if: ${{ env.REF_NAME == 'development' }} + needs: build_dev uses: ./.github/workflows/deploy.yml + with: + runner: prox-2 secrets: USER_AUTH: ${{ secrets.USER_AUTH }}