Skip to content

Commit

Permalink
<
Browse files Browse the repository at this point in the history
  • Loading branch information
JustTNE committed Dec 30, 2023
1 parent cf279b8 commit 4e54c47
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 6 deletions.
1 change: 0 additions & 1 deletion .ci/on-commit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/bin/bash
set -e -o pipefail
set -x

# This script is used to determine which packages to build based on the recent commits and run necessary checks

Expand Down
5 changes: 5 additions & 0 deletions .ci/on-schedule.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -e -o pipefail

# This script is triggered by a scheduled pipeline

8 changes: 3 additions & 5 deletions .github/workflows/on-commit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This is a basic workflow to help you get started with Actions

name: On Commit

permissions:
Expand All @@ -24,7 +22,7 @@ concurrency:
cancel-in-progress: false

jobs:
parse:
process:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -42,7 +40,7 @@ jobs:
SCHEDULE_PARAMS: ${{ steps.parse.outputs.SCHEDULE_PARAMS }}
schedule:
runs-on: ubuntu-latest
needs: parse
needs: process
container:
image: registry.gitlab.com/garuda-linux/tools/chaotic-manager/manager
steps:
Expand All @@ -56,4 +54,4 @@ jobs:
SCHEDULE_PARAMS: ${{ needs.parse.outputs.SCHEDULE_PARAMS }}
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
if: ${{ needs.parse.outputs.SCHEDULE_PARAMS != '' }}
if: ${{ needs.process.outputs.SCHEDULE_PARAMS != '' }}
57 changes: 57 additions & 0 deletions .github/workflows/on-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: On Schedule

permissions:
contents: write

env:
BUILD_REPO: chaotic-aur
GIT_AUTHOR_EMAIL: [email protected]
GIT_AUTHOR_NAME: GitLab CI
REDIS_SSH_HOST: builds.garudalinux.org
REDIS_SSH_PORT: 400
REDIS_SSH_USER: package-deployer
REPO_NAME: chaotic-aur

# Controls when the workflow will run
on:
push:
branches: [ "main" ]

concurrency:
group: chaotic
cancel-in-progress: false

jobs:
process:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Execute on-schedule tasks...
id: parse
run: |
.ci/on-schedule.sh
if [ -f .ci/schedule-params.txt ]; then
params=$(cat .ci/schedule-params.txt)
echo "SCHEDULE_PARAMS=$params" >> "$GITHUB_OUTPUT"
fi
outputs:
SCHEDULE_PARAMS: ${{ steps.parse.outputs.SCHEDULE_PARAMS }}
schedule:
runs-on: ubuntu-latest
needs: process
container:
image: registry.gitlab.com/garuda-linux/tools/chaotic-manager/manager
steps:
- name: Schedule jobs
run: |
[[ -z ${DEPLOY_KEY+x} ]] && echo "No deploy key available, backing off!" && exit 1
echo "$DEPLOY_KEY" >/app/sshkey
chmod 400 /app/sshkey
/entry_point.sh $SCHEDULE_PARAMS
env:
SCHEDULE_PARAMS: ${{ needs.parse.outputs.SCHEDULE_PARAMS }}
REDIS_PASSWORD: ${{ secrets.REDIS_PASSWORD }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
if: ${{ needs.process.outputs.SCHEDULE_PARAMS != '' }}

0 comments on commit 4e54c47

Please sign in to comment.