ci(docker): add node image build-and-push job to workflow
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -84,3 +84,43 @@ jobs:
|
|||||||
git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:${{ github.sha }}
|
git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:${{ github.sha }}
|
||||||
cache-from: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:buildcache
|
cache-from: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:buildcache
|
||||||
cache-to: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:buildcache,mode=max
|
cache-to: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/database:buildcache,mode=max
|
||||||
|
|
||||||
|
build-node:
|
||||||
|
name: Build node image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 2
|
||||||
|
|
||||||
|
- name: Check if node image should be rebuilt
|
||||||
|
id: changed
|
||||||
|
run: |
|
||||||
|
CHANGED=$(git diff --name-only HEAD~1 HEAD | grep -E '^(docker/node/|assets/|package(-lock)?\.json|vite\.config\.js)' | wc -l)
|
||||||
|
echo "changed=$([ "$CHANGED" -gt 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
if: steps.changed.outputs.changed == 'true'
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Gitea registry
|
||||||
|
if: steps.changed.outputs.changed == 'true'
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.lclr.dev
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push node
|
||||||
|
if: steps.changed.outputs.changed == 'true'
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: docker/node/Dockerfile
|
||||||
|
target: dev
|
||||||
|
push: true
|
||||||
|
tags: |
|
||||||
|
git.lclr.dev/thibaud-lclr/ltbxd-actorle/node:latest
|
||||||
|
git.lclr.dev/thibaud-lclr/ltbxd-actorle/node:${{ github.sha }}
|
||||||
|
cache-from: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/node:buildcache
|
||||||
|
cache-to: type=registry,ref=git.lclr.dev/thibaud-lclr/ltbxd-actorle/node:buildcache,mode=max
|
||||||
|
|||||||
Reference in New Issue
Block a user