Compare commits
7 commits
77acf0623d
...
e001c5f940
Author | SHA1 | Date | |
---|---|---|---|
|
e001c5f940 | ||
|
729ffe9584 | ||
|
2b50c8f39f | ||
|
a89ee9c43e | ||
|
7812472b2b | ||
|
2565fc8676 | ||
|
5f8c4791de |
2 changed files with 46 additions and 59 deletions
|
@ -9,40 +9,33 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: setup ssh
|
# - name: setup ssh
|
||||||
run: |
|
# run: |
|
||||||
cat <<EOF > .id_rsa
|
# cat <<EOF > .id_rsa
|
||||||
${{ secrets.SSH_KEY }}
|
# ${{ secrets.SSH_KEY }}
|
||||||
EOF
|
# EOF
|
||||||
chmod 600 .id_rsa
|
# 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"
|
#- name: nix build orbi
|
||||||
SSH_AUTH_SOCK="$SSH_AUTH_SOCK"
|
# run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
|
||||||
SSH_AGENT_PID=$SSH_AGENT_PID
|
|
||||||
EOF
|
|
||||||
|
|
||||||
- run: nix flake archive
|
#- name: nix build cream
|
||||||
|
# run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
|
||||||
|
|
||||||
- name: nix flake check
|
#- name: nix build cherry
|
||||||
run: nix flake check --verbose --log-format raw
|
# run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
|
||||||
|
|
||||||
- name: teardown ssh
|
#- name: nix build chungus
|
||||||
if: always()
|
# run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
|
||||||
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
|
|
||||||
|
|
|
@ -2,54 +2,48 @@ name: Update Nix flakes and commit changes
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "5/10 * * * *"
|
- cron: "40 10 * * *" # not to frequent, GitHub only allows a few pulls per hour
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-and-commit:
|
update-and-commit:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: checkout repository
|
- name: checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: "update"
|
ref: "update"
|
||||||
|
depth: 0
|
||||||
|
|
||||||
- name: setup git
|
- name: setup git
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@git.ingolf-wagner.de"
|
git config --local user.email "action@git.ingolf-wagner.de"
|
||||||
git config --local user.name "Forgejo Action"
|
git config --local user.name "Forgejo Action"
|
||||||
|
|
||||||
- name: rebase with main branch
|
# fixme: not working for some reason
|
||||||
run: |
|
#- name: rebase with main branch
|
||||||
git fetch origin main
|
# run: |
|
||||||
git rebase origin/main
|
# 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
|
|
||||||
|
|
||||||
- name: update nix flakes
|
- name: update nix flakes
|
||||||
run: nix flake update
|
|
||||||
|
|
||||||
- name: commit and push changes
|
|
||||||
run: |
|
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 --quiet && \
|
||||||
git diff --staged --quiet || \
|
git diff --staged --quiet || \
|
||||||
(git commit -am "Update Nix flakes" && git push)
|
(git commit -am "Update Nix flakes" && git push)
|
||||||
|
|
||||||
- name: teardown ssh
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo $SSH_AGENT_PID
|
echo $SSH_AGENT_PID
|
||||||
kill $SSH_AGENT_PID
|
kill $SSH_AGENT_PID
|
||||||
|
|
Loading…
Reference in a new issue