Optimize github build workflow

This commit is contained in:
Karmaa
2025-03-16 20:32:06 -05:00
parent faa60692e7
commit 0ccf3b42e4
3 changed files with 67 additions and 56 deletions

View File

@@ -16,24 +16,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'
- name: Install Dependencies and Build Frontend
run: |
cd src
npm ci
npm run build
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
driver-opts: |
image=moby/buildkit:v0.12.0
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Docker Registry
uses: docker/login-action@v2
@@ -61,6 +59,16 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ env.REPO_OWNER }}/termix:${{ env.IMAGE_TAG }}
labels: org.opencontainers.image.source=https://github.com/${{ github.repository }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1
# Temp fix for https://github.com/docker/build-push-action/issues/252
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Notify via ntfy
run: |