Compare commits

...

7 commits

Author SHA1 Message Date
Ingolf Wagner
e001c5f940
try to fix the git push frogejo action 2024-07-21 10:49:25 +02:00
Ingolf Wagner
729ffe9584
try to fix the git push frogejo action 2024-07-21 10:29:26 +02:00
Ingolf Wagner
2b50c8f39f
try to fix the git push frogejo action 2024-07-21 10:09:56 +02:00
Ingolf Wagner
a89ee9c43e
fix cron job interval 2024-07-21 09:04:09 +02:00
Ingolf Wagner
7812472b2b
fix cron job interval 2024-07-21 00:55:13 +02:00
Ingolf Wagner
2565fc8676
fix cron job interval 2024-07-21 00:54:53 +02:00
Ingolf Wagner
5f8c4791de
forgejo action 2024-07-21 00:08:51 +02:00
2 changed files with 46 additions and 59 deletions

View file

@ -9,40 +9,33 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: setup ssh
run: |
cat <<EOF > .id_rsa
${{ secrets.SSH_KEY }}
EOF
chmod 600 .id_rsa
# - name: setup ssh
# run: |
# cat <<EOF > .id_rsa
# ${{ secrets.SSH_KEY }}
# EOF
# chmod 600 .id_rsa
#
# eval $(ssh-agent)
# ssh-add .id_rsa
#
# nix flake archive
#
# echo $SSH_AGENT_PID
# kill $SSH_AGENT_PID
#
# - name: nix flake check
# run: nix flake check --verbose --log-format raw
eval $(ssh-agent)
ssh-add .id_rsa
cat <<EOF > "$GITHUB_ENV"
SSH_AUTH_SOCK="$SSH_AUTH_SOCK"
SSH_AGENT_PID=$SSH_AGENT_PID
EOF
#- name: nix build orbi
# run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
- run: nix flake archive
#- name: nix build cream
# run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
- name: nix flake check
run: nix flake check --verbose --log-format raw
#- name: nix build cherry
# run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
- name: teardown ssh
if: always()
run: |
echo $SSH_AGENT_PID
kill $SSH_AGENT_PID
- name: nix build orbi
run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
- name: nix build cream
run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
- name: nix build cherry
run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
- name: nix build chungus
run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
#- name: nix build chungus
# run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel

View file

@ -2,54 +2,48 @@ name: Update Nix flakes and commit changes
on:
schedule:
- cron: "5/10 * * * *"
- cron: "40 10 * * *" # not to frequent, GitHub only allows a few pulls per hour
jobs:
update-and-commit:
runs-on: native
steps:
- name: checkout repository
uses: actions/checkout@v2
with:
ref: "update"
depth: 0
- name: setup git
run: |
git config --local user.email "action@git.ingolf-wagner.de"
git config --local user.name "Forgejo Action"
- name: rebase with main branch
run: |
git fetch origin main
git rebase origin/main
- name: setup ssh
run: |
cat <<EOF > .id_rsa
${{ secrets.SSH_KEY }}
EOF
chmod 600 .id_rsa
eval $(ssh-agent)
ssh-add .id_rsa
cat <<EOF > "$GITHUB_ENV"
SSH_AUTH_SOCK="$SSH_AUTH_SOCK"
SSH_AGENT_PID=$SSH_AGENT_PID
EOF
# fixme: not working for some reason
#- name: rebase with main branch
# run: |
# git fetch origin main
# git rebase origin/main
- name: update nix flakes
run: nix flake update
- name: commit and push changes
run: |
cat <<EOF > .ssh_key
${{ secrets.SSH_KEY }}
EOF
chmod 600 .ssh_key
eval $(ssh-agent)
ssh-add .ssh_key
nix flake update
export GITHUB_TOKEN=""
git diff --quiet && \
git diff --staged --quiet || \
(git commit -am "Update Nix flakes" && git push)
- name: teardown ssh
if: always()
run: |
echo $SSH_AGENT_PID
kill $SSH_AGENT_PID