Skip to content

Commit

Permalink
ci: add initial Ci pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan-Kim2028 committed Oct 23, 2024
1 parent bea4d0e commit 59883a6
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-20.04
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3

# Step 2: Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# Step 3: Cache Docker layers to speed up builds
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ubuntu-20.04-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-
# Step 4: Build Docker Image
- name: Build Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: false
tags: bidder-node-docker:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

# Step 5: Move Cache
- name: Move Cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
# # Step 6: Run Tests (Optional)
# - name: Run Tests
# run: |
# # Example: Run your test script or commands
# # Replace with actual test commands relevant to your project
# docker run --rm bidder-node-docker:latest /bin/bash -c "echo Running tests && exit 0"

0 comments on commit 59883a6

Please sign in to comment.