Skip to content

Commit

Permalink
Merge pull request #73 from soubinan/features
Browse files Browse the repository at this point in the history
remove manual run..
  • Loading branch information
soubinan authored Jan 16, 2025
2 parents 4e6d47b + 868f43e commit 845fa8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 23 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ jobs:

image-build:
needs: init
if: ${{needs.init.outputs.app_version}} != "null" && ${{needs.init.outputs.app_version}} != ""
if: ${{needs.init.outputs.app_version != 'null' && needs.init.outputs.app_version != ''}}
runs-on: ubuntu-latest
strategy:
matrix:
architectures: ${{ fromJson(needs.init.outputs.architectures) }}
architectures: ${{fromJson(needs.init.outputs.architectures)}}
steps:
- name: Check submitted version
id: version-check
Expand All @@ -73,15 +73,15 @@ jobs:
- name: Check necessary steps
id: validity-checks
run: |
echo "IS_BUILDABLE=${{github.event_name != 'schedule' || (steps.version-check.outputs.SUBMITTED_BUILD_ID != steps.version-check.outputs.CHECKED_BUILD_ID && github.event_name == 'schedule')}}" >> $GITHUB_OUTPUT
echo "IS_PUBLISHABLE=${{inputs.branch_name == 'test' || (steps.version-check.outputs.SUBMITTED_BUILD_ID != steps.version-check.outputs.CHECKED_BUILD_ID && github.event_name == 'schedule') || (inputs.branch_name == 'main' && inputs.is_merged == true)}}" >> $GITHUB_OUTPUT
echo "IS_BUILDABLE=${{github.event_name == 'pull_request' || (steps.version-check.outputs.SUBMITTED_BUILD_ID != steps.version-check.outputs.CHECKED_BUILD_ID && github.event_name == 'schedule')}}" >> $GITHUB_OUTPUT
echo "IS_PUBLISHABLE=${{inputs.branch_name == 'test' || (inputs.branch_name == 'main' && inputs.is_merged == true)}}" >> $GITHUB_OUTPUT
- name: Check out repository
uses: actions/checkout@v4
if: ${{steps.validity-checks.outputs.IS_BUILDABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true'}}

- name: Install required tools
if: ${{steps.validity-checks.outputs.IS_BUILDABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true'}}
run: |
sudo apt-get update -y
sudo apt-get install -y debootstrap squashfs-tools wget unzip python3 python3-pip
Expand All @@ -95,12 +95,12 @@ jobs:
sudo -v ; wget -q https://kcl-lang.io/script/install-cli.sh -O - | sudo bash
- name: Create Distrobuilder LXC template file
if: ${{steps.validity-checks.outputs.IS_BUILDABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true'}}
run: |
kcl run ${{github.workspace}}/__layout.k -D input=${{github.workspace}}/${{inputs.config_path}} -o /tmp/${{needs.init.outputs.app_name}}.build
- name: Build Image
if: ${{steps.validity-checks.outputs.IS_BUILDABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true'}}
run: |
sudo distrobuilder --cache-dir /tmp/cache/${{needs.init.outputs.app_name}} build-lxc /tmp/${{needs.init.outputs.app_name}}.build -o image.serial="${{needs.init.outputs.app_version}}" -o image.architecture=${{matrix.architectures}} /tmp/output/${{needs.init.outputs.app_name}}/
mv /tmp/output/${{needs.init.outputs.app_name}}/rootfs.tar.xz ./${{needs.init.outputs.app_name}}-${{needs.init.outputs.app_version}}-${{matrix.architectures}}-root.tar.xz
Expand All @@ -109,7 +109,7 @@ jobs:
pwd && ls -lash
- name: Publish Image files
if: ${{steps.validity-checks.outputs.IS_PUBLISHABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true' && steps.validity-checks.outputs.IS_PUBLISHABLE == 'true'}}
run: |
cat << EOF > /tmp/rclone.conf
$RCLONE_CONFIG
Expand All @@ -124,7 +124,7 @@ jobs:
RCLONE_CONFIG_PASS: ${{secrets.RCLONE_CONFIG_PASS}}

- name: Publish Image metadata
if: ${{steps.validity-checks.outputs.IS_PUBLISHABLE}} == true
if: ${{steps.validity-checks.outputs.IS_BUILDABLE == 'true' && steps.validity-checks.outputs.IS_PUBLISHABLE == 'true'}}
run: |
CATEGORIES_STR="${{needs.init.outputs.categories}}"
CATEGORIES_FMT=$(echo "[\"$CATEGORIES_STR\"]" | sed -E 's/^\["[ ,]+/["/g' | sed -E 's/[ ,]+"]$/"]/g' | sed -E 's/ *, */","/g')
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ on:
- "./templates/*"
schedule:
- cron: "0 0 */7 * *"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
type: choice
options:
- warning
- info
- debug

jobs:
init:
Expand All @@ -38,7 +27,7 @@ jobs:
uses: tj-actions/changed-files@v45
with:
files: templates/**
if: ${{github.event_name}} == 'pull_request'
if: ${{github.event_name == 'pull_request'}}

- name: List all templates
id: all-templates-list
Expand Down
2 changes: 1 addition & 1 deletion templates/zitadel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ instructions:
mkdir -p /opt/zitadel
echo "ZITADEL_DATABASE_POSTGRES_USER_PASSWORD=$(/usr/bin/openssl rand -hex 16)" >> /opt/zitadel/.env
echo "ZITADEL_MASTERKEY=$(/usr/bin/openssl rand -hex 32)" >> /opt/zitadel/.env
echo "ZITADEL_MASTERKEY=$(/usr/bin/openssl rand -hex 16)" >> /opt/zitadel/.env
PG_VERSION=$(ls -1 /etc/postgresql)
Expand Down

0 comments on commit 845fa8d

Please sign in to comment.