Skip to content

Commit 377236f

Browse files
committed
ci: add a workflow to build images
1 parent 3fb106f commit 377236f

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build-image.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Images to GHCR
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
workflow_dispatch:
8+
9+
permissions:
10+
packages: write
11+
contents: read
12+
13+
jobs:
14+
build-docker-image:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: 'Checkout repo'
18+
uses: actions/checkout@main
19+
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v3
22+
23+
- name: 'Login to GitHub Container Registry'
24+
uses: docker/login-action@v3
25+
with:
26+
registry: ghcr.io
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Build and push
31+
uses: docker/build-push-action@v5
32+
with:
33+
context: .
34+
platforms: linux/amd64,linux/arm64
35+
push: true
36+
cache-from: type=gha
37+
cache-to: type=gha,mode=max
38+
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}

0 commit comments

Comments
 (0)