Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove manual run.. #73

Merged
merged 5 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading