-
Notifications
You must be signed in to change notification settings - Fork 225
51 lines (42 loc) · 1.52 KB
/
push-to-ghcr.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
name: Push to GitHub Container Registry
on:
workflow_dispatch:
push:
branches:
- main
env:
BACKEND_IMAGE_NAME: agenta-backend
WEB_IMAGE_NAME: agenta-web
IMAGE_OWNER_NAME: agenta-ai
REPOSITORY_USERNAME: ${{ github.actor }}
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
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: Clear Docker build cache
run: docker builder prune --all --force
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.REPOSITORY_USERNAME }}
password: ${{ secrets.DOCKER_GITHUB_SECRETS }}
- name: Build, tag and push Backend image to Github Container Registry
id: build-backend-image
run: |
cd agenta-backend
docker build -t ghcr.io/${{ env.IMAGE_OWNER_NAME }}/${{ env.BACKEND_IMAGE_NAME }} -f Dockerfile.gh .
docker push ghcr.io/${{ env.IMAGE_OWNER_NAME }}/${{ env.BACKEND_IMAGE_NAME }}
- name: Build, tag and push Web image to Github Container Registry
id: build-web-image
run: |
cd agenta-web
docker build --no-cache -t ghcr.io/${{ env.IMAGE_OWNER_NAME }}/${{ env.WEB_IMAGE_NAME }} -f prod.gh.Dockerfile .
docker push ghcr.io/${{ env.IMAGE_OWNER_NAME }}/${{ env.WEB_IMAGE_NAME }}