Copy root pnpm-lock.yaml into app context for Docker builds

Each app's Dockerfile expects a lockfile but docker build context is
scoped to the app directory. Copy it in before build, remove after.
This commit is contained in:
Julia McGhee
2026-03-20 19:46:34 +00:00
parent d1f2bd1fc5
commit e13a008860

View File

@@ -36,10 +36,12 @@ jobs:
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
IFS=',' read -ra APPS <<< "${{ steps.changes.outputs.apps }}" IFS=',' read -ra APPS <<< "${{ steps.changes.outputs.apps }}"
for app in "${APPS[@]}"; do for app in "${APPS[@]}"; do
cp pnpm-lock.yaml apps/${app}/pnpm-lock.yaml
docker build \ docker build \
-t ghcr.io/${{ github.repository_owner }}/homelab-${app}:${{ github.sha }} \ -t ghcr.io/${{ github.repository_owner }}/homelab-${app}:${{ github.sha }} \
-t ghcr.io/${{ github.repository_owner }}/homelab-${app}:latest \ -t ghcr.io/${{ github.repository_owner }}/homelab-${app}:latest \
apps/${app} apps/${app}
rm apps/${app}/pnpm-lock.yaml
docker push ghcr.io/${{ github.repository_owner }}/homelab-${app}:${{ github.sha }} docker push ghcr.io/${{ github.repository_owner }}/homelab-${app}:${{ github.sha }}
docker push ghcr.io/${{ github.repository_owner }}/homelab-${app}:latest docker push ghcr.io/${{ github.repository_owner }}/homelab-${app}:latest
done done