Skip to content

chore: leverage previous layer image #100

chore: leverage previous layer image

chore: leverage previous layer image #100

name: Push workflow
on: push
jobs:
devcontainer-cache-build:
# uses: rcwbr/devcontainer-cache-build/.github/workflows/[email protected]
uses: rcwbr/devcontainer-cache-build/.github/workflows/devcontainer-cache-build.yaml@21-output-all-bake-config-layers-to-github # TODO revert
with:
devcontainer-cache-build-image-override: ghcr.io/rcwbr/devcontainer-cache-build:21-output-all-bake-config-layers-to-github-dd8f037ccbecbf76f9961637c611fe88cc73eb05
permissions:
packages: write
release-it-workflow:
uses: rcwbr/release-it-gh-workflow/.github/workflows/[email protected]
with:
app-id: 1050683 # dockerfile-partials release-it app
app-environment: Repo release
# Use the file bumper release-it image
release-it-image: ghcr.io/rcwbr/release-it-docker-file-bumper:0.7.0
secrets:
app-secret: ${{ secrets.RELEASE_IT_GITHUB_APP_KEY }} # Secret belonging to the Repo release environment
pre-commit:
name: pre-commit
runs-on: ubuntu-24.04
needs: devcontainer-cache-build
container:
image: ${{ fromJSON(needs.devcontainer-cache-build.outputs.devcontainer-cache-image-all_configs)["target"]["pre-commit"]["args"]["DEVCONTAINER_PRE_COMMIT_IMAGE"] }}

Check failure on line 25 in .github/workflows/push-workflow.yaml

View workflow run for this annotation

GitHub Actions / Push workflow

Invalid workflow file

The workflow is not valid. .github/workflows/push-workflow.yaml (Line: 25, Col: 14): Unexpected symbol: '"target"'. Located at position 87 within expression: fromJSON(needs.devcontainer-cache-build.outputs.devcontainer-cache-image-all_configs)["target"]["pre-commit"]["args"]["DEVCONTAINER_PRE_COMMIT_IMAGE"]
steps:
- name: Checkout
uses: actions/[email protected]
- name: pre-commit
run: |
pwd
ls -la
which pre-commit
cat /usr/local/bin/pre-commit
ls -la /opt/devcontainers/pre-commit/
env
git config --global --add safe.directory $GITHUB_WORKSPACE
git status
pre-commit run --verbose --show-diff-on-failure --color=always --all-files
dive-efficiency:
name: Dive Docker image space efficiency analysis
runs-on: ubuntu-24.04
permissions:
packages: write
steps:
- name: Checkout
uses: actions/[email protected]
- name: GHCR Login
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build all-layers image
env:
DEVCONTAINER_DEFINITION_TYPE: bake
DEVCONTAINER_IMAGE: dockerfile-partials-all-layers
DEVCONTAINER_PUSH_IMAGE: false
DEVCONTAINER_REGISTRY: ghcr.io/rcwbr
DEVCONTAINER_CACHE_BUILD_OVERRIDE_USER: codespace
DEVCONTAINER_CACHE_BUILD_OVERRIDE_UID: 1000
DEVCONTAINER_CACHE_BUILD_OVERRIDE_USER_GID: 1000
run: |
devcontainer_definition_files_arr=(
devcontainer-bake.hcl
docker-client/devcontainer-bake.hcl
useradd/devcontainer-bake.hcl
pre-commit/devcontainer-bake.hcl
.github/workflows/all-layers-image.hcl
)
DEVCONTAINER_DEFINITION_FILES="${devcontainer_definition_files_arr[*]}"
export DEVCONTAINER_DEFINITION_FILES
curl https://raw.githubusercontent.com/rcwbr/devcontainer-cache-build/0.3.0/devcontainer-cache-build-initialize | bash
- name: Dive analyze
run: |
docker run \
--rm \
-e CI=true \
-v $(pwd)/.dive-ci:/etc/.dive-ci \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:v0.12.0 \
--ci-config /etc/.dive-ci dockerfile-partials-all-layers