mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-23 20:08:28 +01:00
Compare commits
5 commits
acc32c0343
...
00e37eb467
| Author | SHA1 | Date | |
|---|---|---|---|
| 00e37eb467 | |||
| 29e7613021 | |||
| 746264185f | |||
| 43752a7f77 | |||
| c59058920d |
3 changed files with 6 additions and 28 deletions
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
|
|
@ -76,17 +76,10 @@ jobs:
|
||||||
trigger-deploy:
|
trigger-deploy:
|
||||||
needs: [build-check, build-server]
|
needs: [build-check, build-server]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
|
||||||
previous-sha: ${{ steps.previous-sha.outputs.sha }}
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Get previous deploy SHA
|
|
||||||
id: previous-sha
|
|
||||||
run: |
|
|
||||||
sha=$(git ls-remote origin deploy | cut -f1)
|
|
||||||
printf "sha=%s" "$sha" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Push to deploy branch
|
- name: Push to deploy branch
|
||||||
run: git push --force origin HEAD:refs/heads/deploy
|
run: git push --force origin HEAD:refs/heads/deploy
|
||||||
await-deploy:
|
await-deploy:
|
||||||
|
|
@ -117,20 +110,6 @@ jobs:
|
||||||
|
|
||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
rollback-deploy:
|
|
||||||
if: always() && needs.await-deploy.result == 'failure'
|
|
||||||
needs: [trigger-deploy, await-deploy]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
token: ${{ secrets.PAT }}
|
|
||||||
- name: Rollback deploy branch
|
|
||||||
run: |
|
|
||||||
previous_sha="${{ needs.trigger-deploy.outputs.previous-sha }}"
|
|
||||||
echo "Rolling back deploy branch to $previous_sha"
|
|
||||||
git push --force origin "$previous_sha:refs/heads/deploy"
|
|
||||||
notify:
|
notify:
|
||||||
if: always()
|
if: always()
|
||||||
needs: [await-deploy]
|
needs: [await-deploy]
|
||||||
|
|
@ -145,7 +124,7 @@ jobs:
|
||||||
-H "Tags: white_check_mark" \
|
-H "Tags: white_check_mark" \
|
||||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
-H "Markdown: yes" \
|
-H "Markdown: yes" \
|
||||||
-d "Commit \`${GITHUB_SHA::7}\` deployed successfully." \
|
-d $'Commit `'"${GITHUB_SHA::7}"$'` deployed successfully.\n\n> ${{ github.event.head_commit.message }}' \
|
||||||
https://ntfy.sh/splitleaf
|
https://ntfy.sh/splitleaf
|
||||||
- name: Notify failure
|
- name: Notify failure
|
||||||
if: needs.await-deploy.result == 'failure'
|
if: needs.await-deploy.result == 'failure'
|
||||||
|
|
@ -156,5 +135,5 @@ jobs:
|
||||||
-H "Tags: rotating_light" \
|
-H "Tags: rotating_light" \
|
||||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||||
-H "Markdown: yes" \
|
-H "Markdown: yes" \
|
||||||
-d "Commit \`${GITHUB_SHA::7}\` failed to deploy." \
|
-d $'Commit `'"${GITHUB_SHA::7}"$'` failed to deploy.\n\n> ${{ github.event.head_commit.message }}' \
|
||||||
https://ntfy.sh/splitleaf
|
https://ntfy.sh/splitleaf
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
general = {
|
general = {
|
||||||
animationSpeed = 1.8;
|
animationSpeed = 1.8;
|
||||||
enableShadows = false;
|
enableShadows = false;
|
||||||
|
dimmerOpacity = 0.1;
|
||||||
compactLockScreen = true;
|
compactLockScreen = true;
|
||||||
clockStyle = "digital";
|
clockStyle = "digital";
|
||||||
autoStartAuth = true;
|
autoStartAuth = true;
|
||||||
|
|
@ -96,6 +97,7 @@
|
||||||
largeButtonsStyle = false;
|
largeButtonsStyle = false;
|
||||||
countdownDuration = 3000;
|
countdownDuration = 3000;
|
||||||
};
|
};
|
||||||
|
idle.enabled = true;
|
||||||
audio.mprisBlacklist = "firefox";
|
audio.mprisBlacklist = "firefox";
|
||||||
location = {
|
location = {
|
||||||
firstDayOfWeek = 1;
|
firstDayOfWeek = 1;
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@ let
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
token=$(cat "''${CREDENTIALS_DIRECTORY}/git-push-token")
|
token=$(cat "${config.sops.secrets."git/push-token".path}")
|
||||||
repo_url="https://x-access-token:$token@github.com/SebastianStork/nixos-config.git"
|
repo_url="https://x-access-token:$token@github.com/SebastianStork/nixos-config.git"
|
||||||
|
|
||||||
git push --force "$repo_url" "$COMIN_GIT_SHA:refs/heads/deployed/$COMIN_HOSTNAME"
|
git -C /var/lib/comin/repository push --force "$repo_url" "$COMIN_GIT_SHA:refs/heads/deployed/$COMIN_HOSTNAME"
|
||||||
|
|
||||||
echo "Updated deployed/$COMIN_HOSTNAME to $COMIN_GIT_SHA"
|
echo "Updated deployed/$COMIN_HOSTNAME to $COMIN_GIT_SHA"
|
||||||
'';
|
'';
|
||||||
|
|
@ -41,9 +41,6 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
sops.secrets."git/push-token" = { };
|
sops.secrets."git/push-token" = { };
|
||||||
systemd.services.comin.serviceConfig.LoadCredential = "git-push-token:${
|
|
||||||
config.sops.secrets."git/push-token".path
|
|
||||||
}";
|
|
||||||
|
|
||||||
services.comin = {
|
services.comin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue