Corrected workflow branch selection
This commit is contained in:
@@ -1,45 +0,0 @@
|
|||||||
name: CI/CD for React to AWS Amplify
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
# Testing (Runs automatically on push/PR)
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 24
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: npm ci --legacy-peer-deps
|
|
||||||
|
|
||||||
- name: Run Linter
|
|
||||||
run: npm run lint --if-present
|
|
||||||
|
|
||||||
- name: Run Tests
|
|
||||||
run: npm test -- --watchAll=false
|
|
||||||
|
|
||||||
# Deployment (Waits for manual approval after 'test' passes)
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: test
|
|
||||||
environment: production
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Trigger webhook using curl
|
|
||||||
env:
|
|
||||||
WEBHOOK_URL: ${{ secrets.AMPLIFY_WEBHOOK_URL }}
|
|
||||||
run: |
|
|
||||||
curl -i --fail -X POST -H "Content-Type: application/json" -d '{}' "$WEBHOOK_URL"
|
|
||||||
@@ -32,7 +32,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
language: [ 'javascript' ]
|
language: [ 'javascript', 'python', 'go' ]
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||||
# Learn more:
|
# Learn more:
|
||||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||||
|
|||||||
@@ -2,21 +2,21 @@ name: Frontend Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'frontend/**'
|
- 'frontend/**'
|
||||||
- '.github/workflows/frontend-deploy.yml'
|
- '.github/workflows/frontend-deploy.yml'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
@@ -29,8 +29,21 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci --legacy-peer-deps
|
run: npm ci --legacy-peer-deps
|
||||||
|
|
||||||
- name: Build frontend
|
- name: Run Linter
|
||||||
run: npm run build
|
run: npm run lint --if-present
|
||||||
|
|
||||||
- name: Deploy placeholder
|
- name: Run Tests
|
||||||
run: echo "Deploy the frontend build to AWS Amplify or CloudFront from this step."
|
run: npm test -- --watchAll=false
|
||||||
|
|
||||||
|
# Deployment (Waits for manual approval after 'test' passes)
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
environment: production
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Trigger webhook using curl
|
||||||
|
env:
|
||||||
|
WEBHOOK_URL: ${{ secrets.AMPLIFY_WEBHOOK_URL }}
|
||||||
|
run: |
|
||||||
|
curl -i --fail -X POST -H "Content-Type: application/json" -d '{}' "$WEBHOOK_URL"
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Go Backend Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'backend-go/**'
|
- 'backend-go/**'
|
||||||
- '.github/workflows/go-backend-deploy.yml'
|
- '.github/workflows/go-backend-deploy.yml'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Python Backend Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'backend-python/**'
|
- 'backend-python/**'
|
||||||
- '.github/workflows/python-backend-deploy.yml'
|
- '.github/workflows/python-backend-deploy.yml'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Rust Backend Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'backend-rust/**'
|
- 'backend-rust/**'
|
||||||
- '.github/workflows/rust-backend-deploy.yml'
|
- '.github/workflows/rust-backend-deploy.yml'
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ name: Test Pipeline Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
paths:
|
paths:
|
||||||
- 'pipeline-testing/**'
|
- 'pipeline-testing/**'
|
||||||
- '.github/workflows/test-pipeline-deploy.yml'
|
- '.github/workflows/test-pipeline-deploy.yml'
|
||||||
|
|||||||
Reference in New Issue
Block a user