Skip to content

Commit b4c835c

Browse files
author
CodingKitten
authored
Merge pull request #3 from bo0tzz/main
feat: push images to ghcr
2 parents 495865c + 52affe6 commit b4c835c

2 files changed

Lines changed: 65 additions & 7 deletions

File tree

.github/workflows/docker.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Build and Push Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
pull_request:
8+
branches: [main]
9+
release:
10+
types: [released]
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
permissions:
17+
packages: write
18+
19+
jobs:
20+
build_and_push:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
image: [backend, frontend]
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v5
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3.6.0
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3.11.1
37+
38+
- name: Login to GitHub Container Registry
39+
uses: docker/login-action@v3.5.0
40+
if: ${{ !github.event.pull_request.head.repo.fork }}
41+
with:
42+
registry: ghcr.io
43+
username: ${{ github.repository_owner }}
44+
password: ${{ secrets.GITHUB_TOKEN }}
45+
46+
- name: Generate docker image tags
47+
id: metadata
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: |
51+
name=ghcr.io/${{ github.repository }}-${{ matrix.image }}
52+
53+
- name: Build and push image
54+
uses: docker/build-push-action@v6.18.0
55+
with:
56+
context: ${{ matrix.image }}
57+
platforms: linux/amd64,linux/arm64
58+
push: ${{ !github.event.pull_request.head.repo.fork }}
59+
cache-from: type=gha
60+
cache-to: type=gha,mode=max
61+
tags: ${{ steps.metadata.outputs.tags }}
62+
labels: ${{ steps.metadata.outputs.labels }}

docker-compose.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ name: invio
22

33
services:
44
backend:
5-
build:
6-
context: ./backend
7-
dockerfile: Dockerfile
5+
image: ghcr.io/kittendevv/invio-backend:main
86
env_file:
97
- .env
108
environment:
@@ -19,9 +17,7 @@ services:
1917
restart: unless-stopped
2018

2119
frontend:
22-
build:
23-
context: ./frontend
24-
dockerfile: Dockerfile
20+
image: ghcr.io/kittendevv/invio-frontend:main
2521
env_file:
2622
- .env
2723
environment:
@@ -35,4 +31,4 @@ services:
3531

3632
volumes:
3733
invio_data:
38-
driver: local
34+
driver: local

0 commit comments

Comments
 (0)