-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.42 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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"