Skip to content

chore: Configure Renovate - autoclosed #34

chore: Configure Renovate - autoclosed

chore: Configure Renovate - autoclosed #34

Workflow file for this run

name: Trident Build
on:
push:
# paths:
# - "trident-distrowith/**"
pull_request:
# paths:
# - "trident-distrowith/**"
jobs:
build:
if: |
!github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
defaults:
run:
working-directory: trident-distrowith
steps:
- uses: actions/checkout@v4
- name: Checkout trident repo
run: ./checkout.sh
- name: Patch Dockerfile with alpine and nfs-utils
working-directory: trident-distrowith/trident
run: patch Dockerfile ../dockerfile.patch
- name: Patch chwrap.go to stop searching binaries in /host
working-directory: trident-distrowith/trident
run: patch chwrap/chwrap.go ../chwrap.patch
- name: Patch Makefile to change default registry for images
working-directory: trident-distrowith/trident
run: patch Makefile ../makefile.patch
- name: Run make command
working-directory: trident-distrowith/trident
env:
BUILD_TYPE: stable
run: |
export CUSTOM_IMAGE_TAG=$(echo $GITHUB_REF_NAME | tr "/" "-") && \
make images
- name: List docker images
run: docker image ls
- name: Export docker images as artifacts
run: |
mkdir -p /tmp/docker-images/
docker image ls --format=json | \
jq -s '[.[] | select(.Repository | test("ghcr.io/postfinance/trident.*"))] | unique_by(.ID) |.[] | .Repository + ":" + .Tag' | \
xargs -I_ sh -c 'docker save _ -o /tmp/docker-images/$(echo _ | sed "s|[/:\.]|-|g").tar'
- name: Upload docker images artifacts
uses: actions/upload-artifact@v4
with:
name: custom-trident-images
path: /tmp/docker-images/*.tar
publish:
if: |
startsWith(github.ref, 'refs/heads/') ||
startsWith(github.ref, 'refs/tags/') &&
!github.event.pull_request.head.repo.fork
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: custom-trident-images
path: docker-images/
- name: Display structure of downloaded files
run: find .
- name: Load image(s)
run: |
find docker-images/ -name "*.tar" -exec docker load --input {} \;
docker image ls
- name: Log in to ghcr.io registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Push docker images
run: |
docker image ls --format=json | \
jq 'select(.Repository | test("ghcr.io/postfinance/trident.*")) | .Repository + ":" + .Tag' | \
xargs -I_ docker push _