Compare commits
2 Commits
7e30a419db
...
cbd2f12189
| Author | SHA1 | Date | |
|---|---|---|---|
| cbd2f12189 | |||
| ac3c221711 |
@@ -1,36 +1,11 @@
|
|||||||
name: Apply Kuberentes Configs
|
name: Apply Kuberentes Configs
|
||||||
on: [push, workflow_dispatch]
|
on: [push, workflow_dispatch]
|
||||||
jobs:
|
jobs:
|
||||||
test-environment:
|
|
||||||
runs-on: home-server
|
|
||||||
steps:
|
|
||||||
- name: test basic commands
|
|
||||||
run: |
|
|
||||||
echo "=== Environment Info ==="
|
|
||||||
whoami
|
|
||||||
pwd
|
|
||||||
echo "=== Test bash ==="
|
|
||||||
bash --version
|
|
||||||
echo "=== Test git ==="
|
|
||||||
git --version
|
|
||||||
echo "=== Success ==="
|
|
||||||
update-repo:
|
update-repo:
|
||||||
runs-on: home-server
|
uses: ./.gitea/workflows/update-repo.yml
|
||||||
steps:
|
|
||||||
- name: checkout repo
|
|
||||||
working-directory: /home/gitea-runner
|
|
||||||
run: |
|
|
||||||
if [ -d "infrastructure" ]; then
|
|
||||||
cd infrastructure
|
|
||||||
echo "Infrastructure folder exists. Resetting to the most recent commit."
|
|
||||||
git reset --hard HEAD
|
|
||||||
git pull https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.alexmickelson.guru/${{ gitea.repository }} $(git rev-parse --abbrev-ref HEAD)
|
|
||||||
else
|
|
||||||
git clone https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.alexmickelson.guru/${{ gitea.repository }}.git
|
|
||||||
fi
|
|
||||||
update-infrastructure:
|
update-infrastructure:
|
||||||
runs-on: home-server
|
runs-on: home-server
|
||||||
needs: update-repo
|
needs: update-repo-folder
|
||||||
steps:
|
steps:
|
||||||
- name: update home server containers
|
- name: update home server containers
|
||||||
env:
|
env:
|
||||||
|
|||||||
19
.gitea/workflows/update-repo.yml
Normal file
19
.gitea/workflows/update-repo.yml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Update Repository
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-repo-folder:
|
||||||
|
runs-on: home-server
|
||||||
|
steps:
|
||||||
|
- name: checkout repo
|
||||||
|
working-directory: /home/gitea-runner
|
||||||
|
run: |
|
||||||
|
if [ -d "infrastructure" ]; then
|
||||||
|
cd infrastructure
|
||||||
|
echo "Infrastructure folder exists. Resetting to the most recent commit."
|
||||||
|
git reset --hard HEAD
|
||||||
|
git pull https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.alexmickelson.guru/${{ gitea.repository }} $(git rev-parse --abbrev-ref HEAD)
|
||||||
|
else
|
||||||
|
git clone https://x-access-token:${{ secrets.GITEA_TOKEN }}@git.alexmickelson.guru/${{ gitea.repository }}.git
|
||||||
|
fi
|
||||||
@@ -32,10 +32,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.pathsToLink = [
|
|
||||||
"/bin"
|
|
||||||
];
|
|
||||||
|
|
||||||
users.users.gitea-runner = {
|
users.users.gitea-runner = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
description = "Gitea Actions Runner";
|
description = "Gitea Actions Runner";
|
||||||
@@ -51,23 +47,12 @@ users.users.gitea-runner = {
|
|||||||
|
|
||||||
users.groups.gitea-runner = { };
|
users.groups.gitea-runner = { };
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
"d /data/runner 0755 gitea-runner gitea-runner -"
|
|
||||||
"f /data/runner/gitea-infrastructure-token.txt 0600 gitea-runner gitea-runner -"
|
|
||||||
"d /var/lib/gitea-runner 0755 gitea-runner gitea-runner -"
|
|
||||||
"d /var/lib/gitea-runner/infrastructure 0755 gitea-runner gitea-runner -"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Override only the sandboxing settings, keep ExecStart from the module
|
|
||||||
systemd.services.gitea-runner-infrastructure.serviceConfig = {
|
systemd.services.gitea-runner-infrastructure.serviceConfig = {
|
||||||
# Keep the working directory
|
|
||||||
WorkingDirectory = lib.mkForce "/var/lib/gitea-runner/infrastructure";
|
WorkingDirectory = lib.mkForce "/var/lib/gitea-runner/infrastructure";
|
||||||
|
|
||||||
# Override user/group
|
|
||||||
User = lib.mkForce "gitea-runner";
|
User = lib.mkForce "gitea-runner";
|
||||||
Group = lib.mkForce "gitea-runner";
|
Group = lib.mkForce "gitea-runner";
|
||||||
|
|
||||||
# Remove ALL sandboxing - run as a normal user process
|
|
||||||
DynamicUser = lib.mkForce false;
|
DynamicUser = lib.mkForce false;
|
||||||
PrivateDevices = lib.mkForce false;
|
PrivateDevices = lib.mkForce false;
|
||||||
PrivateMounts = lib.mkForce false;
|
PrivateMounts = lib.mkForce false;
|
||||||
@@ -93,7 +78,6 @@ systemd.services.gitea-runner-infrastructure.serviceConfig = {
|
|||||||
ReadWritePaths = lib.mkForce [ ];
|
ReadWritePaths = lib.mkForce [ ];
|
||||||
BindReadOnlyPaths = lib.mkForce [ ];
|
BindReadOnlyPaths = lib.mkForce [ ];
|
||||||
|
|
||||||
# Allow access to devices
|
|
||||||
DeviceAllow = lib.mkForce [ "/dev/zfs rw" ];
|
DeviceAllow = lib.mkForce [ "/dev/zfs rw" ];
|
||||||
DevicePolicy = lib.mkForce "auto";
|
DevicePolicy = lib.mkForce "auto";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user