-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.16 KB
/
build-backend.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
name: Backend Build
on:
pull_request:
types: [opened, edited]
paths: ["backend/**"]
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'dev'
defaults:
run:
working-directory: ./backend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Generate .env file
run: echo "DOCKER_USERNAME=${{ secrets.DOCKER_USERNAME }}" >> .env
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Setup docker-compose
uses: KengoTODA/[email protected]
with:
version: "2.24.5"
- name: Create a Builder Instance
run: |
docker buildx create --name buildx
docker buildx use buildx
- name: Build & Push Docker Cache
run: |
docker-compose -f compose.cache-export.yml build --builder buildx --build-arg BUILDKIT_INLINE_CACHE=1
docker-compose -f compose.cache-export.yml push