-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (41 loc) · 1.3 KB
/
Copy pathdocker.yaml
File metadata and controls
50 lines (41 loc) · 1.3 KB
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
name: Build & Push Docker Image
on:
push:
branches: [ dev ]
workflow_dispatch:
# Top-level env: literals only
env:
IMAGE_NAME: fedpilot
REGISTRY: docker.io
jobs:
build-and-push:
if: contains(github.event.head_commit.message, '[DEPLOY]')
runs-on: ubuntu-latest
# Job-level env: expressions allowed
env:
DOCKERHUB_REPO: ${{ vars.REGISTRY }}/${{ secrets.DOCKER_HUB_USERNAME }}/${{ vars.IMAGE_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build & push (amd64 + arm64)
uses: docker/build-push-action@v5
with:
context: .
file: deployment/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fedpilot:beta
docker.io/${{ secrets.DOCKER_HUB_USERNAME }}/fedpilot:${{ github.sha }}
build-args: |
BUILDKIT_INLINE_CACHE=1