-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (40 loc) · 1.22 KB
/
build.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
name: Build
on:
workflow_dispatch:
workflow_call:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
# 1️⃣ Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
# 2️⃣ Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
# 3️⃣ Log in to GitHub Container Registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.MY_GITHUB_TOKEN }}
# 4️⃣ Build & push Backend image (Multi-Platform)
- name: Build & Push Backend Image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t ghcr.io/${{ github.repository_owner }}/idrive-backend:latest \
./backend
# 5️⃣ Build & push Nginx image (Multi-Platform)
- name: Build & Push Nginx Image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
-t ghcr.io/${{ github.repository_owner }}/idrive-nginx:latest \
./frontend