forked from Light-Heart-Labs/DreamServer
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.39 KB
/
build-dreamforge.yml
File metadata and controls
47 lines (40 loc) · 1.39 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
name: Build DreamForge Image
on:
push:
branches: [main]
paths:
- 'dream-server/extensions/services/dreamforge/**'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: light-heart-labs/dreamforge
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v6
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version
id: version
run: |
VERSION=$(grep -oP 'version\s*=\s*"\K[^"]+' dream-server/extensions/services/dreamforge/rust/Cargo.toml | head -1)
echo "version=${VERSION:-0.1.0}" >> "$GITHUB_OUTPUT"
echo "sha_short=$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v7
with:
context: dream-server/extensions/services/dreamforge
file: dream-server/extensions/services/dreamforge/Dockerfile.rust
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.sha_short }}