I currently have 2 workflows to build my back and my front on my project linked to my main
branch.
This workflow works perfectly.
I therefore duplicated this workflow to carry out the same process but for a second pre-prod
branch and thus carry out the build on my pre-prod server.
These new workflows never trigger despite my multiple attempts.
Here is the current workflow that works for my main
branch:
name: Check update and deploy backend
on:
pull_request:
branches:
- main
types:
[closed]
paths:
- 'back/**'
jobs:
changed_files:
if: ${{ github.event.pull_request.merged }}
name: Deploy backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run:
cd back && npm install
// and other jobs tasks
So I made the necessary modifications to achieve the same thing but when merging a branch onto my pre-prod
branch:
name: Check update and deploy preprod backend
on:
pull_request:
branches:
- pre-prod
types:
[closed]
paths:
- 'back/**'
jobs:
changed_files:
if: ${{ github.event.pull_request.merged }}
name: Deploy backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Install dependencies
run:
cd back && npm install
// and other jobs tasks
My .github/workflows
folder is at the root of the project in the main
, pre-prod
branch as well as in that of my feature-branch
which must be merge from my fork.
This workflow is therefore never triggered after a commit, then pull request to remote/pre-prod
then merge from this PR.