Skip to content

Commit 627a63b

Browse files
committed
feat: add workflow to deploy edge image
1 parent bc55f90 commit 627a63b

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/build_edge.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Continues deployment workflow to automatically
2+
# build edge Docker image on push to main branch.
3+
name: Build Edge
4+
5+
on:
6+
push:
7+
branches:
8+
- "main"
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: Install Docker with buildx
19+
uses: docker/setup-buildx-action@v3
20+
with:
21+
buildkitd-flags: --debug
22+
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
26+
- name: Login to GitHub packages
27+
uses: docker/login-action@v3
28+
with:
29+
registry: ghcr.io
30+
username: ${{ github.repository_owner }}
31+
password: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: Login to Lazy Bytez Registry
34+
uses: docker/login-action@v3
35+
with:
36+
registry: git.lazybytez.cloud
37+
username: ${{ secrets.GITEA_REGISTRY_USERNAME }}
38+
password: ${{ secrets.GITEA_REGISTRY_TOKEN }}
39+
40+
- name: Extract metadata (tags, labels) for Docker
41+
id: meta
42+
uses: docker/metadata-action@v5
43+
with:
44+
images: |
45+
ghcr.io/lazybytez/logrotate-container
46+
git.lazybytez.cloud/lazybytez/logrotate-container
47+
tags: |
48+
type=edge,branch=main
49+
type=sha,format=short
50+
51+
- name: Retrieve commit SHA
52+
id: commit_sha
53+
run: |
54+
echo "short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
55+
56+
# Deploy stage image to Gitea Container Registry
57+
- name: Build and publish images
58+
uses: docker/build-push-action@v6
59+
id: build_push
60+
with:
61+
context: .
62+
file: ./Containerfile
63+
platforms: linux/amd64
64+
push: true
65+
tags: ${{ steps.meta.outputs.tags }}
66+
labels: ${{ steps.meta.outputs.labels }}
67+
build-args: |
68+
image_version=edge
69+
build_commit_sha=${{ steps.commit_sha.outputs.short }}

0 commit comments

Comments
 (0)