Skip to content

build_basic_rootfs: add --init parameter #9

build_basic_rootfs: add --init parameter

build_basic_rootfs: add --init parameter #9

Workflow file for this run

name: Release Container
on:
push:
branches:
- main
jobs:
next-version:
runs-on: ubuntu-latest
outputs:
v-version: ${{ steps.version.outputs.v-version }}
matrix: ${{ steps.find_dockerfiles.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup runner
run: |
sudo apt-get update;
sudo apt-get install -yy curl jq
- name: Get next version
uses: reecetech/version-increment@2024.4.4
id: version
with:
use_api: true
- name: Find all the dockerfiles
id: find_dockerfiles
run: |
OUTPUTS=$(find . -type f -name "Dockerfile.*" | xargs -i{} basename {} | cut -d. -f2 | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo matrix=${OUTPUTS} >> $GITHUB_OUTPUT
build_images:
runs-on: ubuntu-latest
needs: [next-version]
strategy:
matrix:
target: ${{ fromJSON(needs.next-version.outputs.matrix) }}
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: rehosting
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Setup runner
run: |
sudo apt-get update;
sudo apt-get install -yy curl jq git
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Generate name from file
id: generate_fname
run: |
echo ::set-output name=fname::$(find . -type f -name "Dockerfile.${{ matrix.target }}" | head -n 1 )
- name: Build Docker image for ${{ matrix.target }}
uses: docker/build-push-action@v6.3.0
with:
context: ${{ github.workspace }}
push: true
cache-from: type=registry,ref=rehosting/examples:${{ matrix.target}}_cache,mode=max
cache-to: type=registry,ref=rehosting/examples:${{ matrix.target }}_cache,mode=max
file: ${{steps.generate_fname.outputs.fname}}
tags: rehosting/examples:${{ matrix.target }},rehosting/examples:${{ matrix.target }}_latest,rehosting/examples:${{ matrix.target }}_${{ needs.next-version.outputs.v-version }}
update:
needs: [next-version, build_images]
runs-on: ubuntu-latest
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.next-version.outputs.v-version}}
release_name: Release ${{ needs.next-version.outputs.v-version }} ${{ github.ref }}
body: |
Release ${{ needs.next-version.outputs.v-version }} @${{ github.ref }}
Contains the following rehostings: ${{ fromJSON(needs.next-version.outputs.matrix) }}
draft: false
prerelease: false