33 lines
809 B
YAML
33 lines
809 B
YAML
name: CI/CD Test
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
types:
|
|
- closed
|
|
|
|
jobs:
|
|
build-deploy:
|
|
runs-on: ubuntu-latest
|
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.merged == true }}
|
|
steps:
|
|
- name: Set up environment
|
|
run: |
|
|
echo "PR #${{ github.event.number }} merged into master"
|
|
echo "Source branch: ${{ github.event.pull_request.head.ref }}"
|
|
echo "Target branch: ${{ github.event.pull_request.base.ref }}"
|
|
- name: Run tests
|
|
run: |
|
|
echo "Running test suite..."
|
|
- name: Build project
|
|
run: |
|
|
echo "Building project..."
|
|
- name: Deploy
|
|
if: success()
|
|
run: |
|
|
echo "Deploying to production..."
|