blob: 2ce5cc286005417ccfeb421b7461b2fb2b6119f1 (
plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
name: CI
on:
push:
branches: [main]
tags: ['v*']
pull_request:
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ghcr.io/sulfurnitride/fluorine-builder
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull or build Docker image
run: |
if docker pull ${{ env.IMAGE_NAME }}:latest; then
docker tag ${{ env.IMAGE_NAME }}:latest fluorine-builder:latest
else
echo "Pull failed, building from scratch..."
docker build -t fluorine-builder:latest docker/
fi
- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.cache/fluorine-ccache
key: ccache-${{ runner.os }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-
- name: Build inside container
run: |
mkdir -p ~/.cache/fluorine-ccache
docker run --rm \
-v "${{ github.workspace }}:/src:rw" \
-v "$HOME/.cache/fluorine-ccache:/ccache:rw" \
-e CCACHE_DIR=/ccache \
-e BUILD_MODE=tarball \
-w /src \
fluorine-builder:latest \
bash /src/docker/build-inner.sh
- name: Upload build
uses: actions/upload-artifact@v4
with:
name: Fluorine-Manager
path: build/fluorine-manager/
compression-level: 6
if-no-files-found: warn
|