Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI/CD Pipeline

on:
push:
branches:
- master
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: |
docker build -t website-build .

- name: Run Docker container for master branch (publish to port 82)
if: github.ref == 'refs/heads/master'
run: |
# Run the Docker container and bind it to port 82
docker run -d -p 82:80 website-build

- name: Run Docker container for develop branch (build only, no publish)
if: github.ref == 'refs/heads/develop'
run: |
# Run the Docker container for development, but don't expose it
docker run -d website-build