try to fix the git push frogejo action
This commit is contained in:
parent
41f53486db
commit
955d1f194d
1 changed files with 98 additions and 48 deletions
|
@ -2,74 +2,124 @@ name: Build all NixOS Configurations
|
||||||
|
|
||||||
on:
|
on:
|
||||||
- push
|
- push
|
||||||
#schedule:
|
|
||||||
# - cron: "20 12 * * *" # not to frequent, GitHub only allows a few pulls per hour
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
nix build:
|
nix build:
|
||||||
runs-on: native
|
runs-on: native
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: checkout repository
|
- name: setup ssh
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
depth: 0
|
|
||||||
|
|
||||||
- name: update nix flakes
|
|
||||||
#if: github.event_name == 'schedule'
|
|
||||||
run: |
|
run: |
|
||||||
cat <<EOF > .ssh_key
|
cat <<EOF > .id_rsa
|
||||||
${{ secrets.SSH_KEY }}
|
${{ secrets.SSH_KEY }}
|
||||||
EOF
|
EOF
|
||||||
chmod 600 .ssh_key
|
chmod 600 .id_rsa
|
||||||
|
|
||||||
eval $(ssh-agent)
|
eval $(ssh-agent)
|
||||||
ssh-add .ssh_key
|
ssh-add .id_rsa
|
||||||
|
|
||||||
nix flake update
|
cat <<EOF > "$GITHUB_ENV"
|
||||||
|
SSH_AUTH_SOCK="$SSH_AUTH_SOCK"
|
||||||
echo $SSH_AGENT_PID
|
SSH_AGENT_PID=$SSH_AGENT_PID
|
||||||
kill $SSH_AGENT_PID
|
|
||||||
rm .ssh_key
|
|
||||||
|
|
||||||
- name: fetch and check
|
|
||||||
run: |
|
|
||||||
cat <<EOF > .ssh_key
|
|
||||||
${{ secrets.SSH_KEY }}
|
|
||||||
EOF
|
EOF
|
||||||
chmod 600 .ssh_key
|
|
||||||
|
|
||||||
eval $(ssh-agent)
|
- run: nix flake archive
|
||||||
ssh-add .ssh_key
|
|
||||||
|
|
||||||
nix flake archive
|
|
||||||
nix flake check --verbose --log-format raw
|
|
||||||
|
|
||||||
|
- name: teardown ssh
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
echo $SSH_AGENT_PID
|
echo $SSH_AGENT_PID
|
||||||
kill $SSH_AGENT_PID
|
kill $SSH_AGENT_PID
|
||||||
rm .ssh_key
|
|
||||||
|
|
||||||
- name: nix build orbi
|
- name: nix flake check
|
||||||
run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
|
run: nix flake check --verbose --log-format raw
|
||||||
|
|
||||||
- name: nix build cream
|
|
||||||
run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
|
|
||||||
|
|
||||||
- name: nix build cherry
|
#- name: nix build orbi
|
||||||
run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
|
# run: nix build .#nixosConfigurations.orbi.config.system.build.toplevel
|
||||||
|
|
||||||
- name: nix build chungus
|
#- name: nix build cream
|
||||||
run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
|
# run: nix build .#nixosConfigurations.cream.config.system.build.toplevel
|
||||||
|
|
||||||
- name: push if all fine (branch update)
|
#- name: nix build cherry
|
||||||
#if: github.event_name == 'schedule'
|
# run: nix build .#nixosConfigurations.cherry.config.system.build.toplevel
|
||||||
run: |
|
|
||||||
|
|
||||||
git config --local user.email "action@git.ingolf-wagner.de"
|
#- name: nix build chungus
|
||||||
git config --local user.name "Forgejo Action"
|
# run: nix build .#nixosConfigurations.chungus.config.system.build.toplevel
|
||||||
|
|
||||||
git diff --quiet && \
|
#name: Build all NixOS Configurations
|
||||||
git diff --staged --quiet || \
|
|
||||||
(git commit -am "Update Nix flakes" && git push)
|
#on:
|
||||||
|
# - push
|
||||||
|
# #schedule:
|
||||||
|
# # - cron: "20 12 * * *" # not to frequent, GitHub only allows a few pulls per hour
|
||||||
|
|
||||||
|
#jobs:
|
||||||
|
|
||||||
|
# nix build:
|
||||||
|
# runs-on: native
|
||||||
|
# steps:
|
||||||
|
|
||||||
|
# - name: checkout repository
|
||||||
|
# uses: actions/checkout@v2
|
||||||
|
# with:
|
||||||
|
# depth: 0
|
||||||
|
|
||||||
|
# - name: update nix flakes
|
||||||
|
# #if: github.event_name == 'schedule'
|
||||||
|
# run: |
|
||||||
|
# cat <<EOF > .ssh_key
|
||||||
|
# ${{ secrets.SSH_KEY }}
|
||||||
|
# EOF
|
||||||
|
# chmod 600 .ssh_key
|
||||||
|
|
||||||
|
# eval $(ssh-agent)
|
||||||
|
# ssh-add .ssh_key
|
||||||
|
|
||||||
|
# nix flake update
|
||||||
|
#
|
||||||
|
# echo $SSH_AGENT_PID
|
||||||
|
# kill $SSH_AGENT_PID
|
||||||
|
# rm .ssh_key
|
||||||
|
|
||||||
|
# - name: fetch and check
|
||||||
|
# run: |
|
||||||
|
# cat <<EOF > .ssh_key
|
||||||
|
# ${{ secrets.SSH_KEY }}
|
||||||
|
# EOF
|
||||||
|
# chmod 600 .ssh_key
|
||||||
|
|
||||||
|
# eval $(ssh-agent)
|
||||||
|
# ssh-add .ssh_key
|
||||||
|
|
||||||
|
# nix flake archive
|
||||||
|
# nix flake check --verbose --log-format raw
|
||||||
|
#
|
||||||
|
# echo $SSH_AGENT_PID
|
||||||
|
# kill $SSH_AGENT_PID
|
||||||
|
# rm .ssh_key
|
||||||
|
|
||||||
|
# - 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: push if all fine (branch update)
|
||||||
|
# #if: github.event_name == 'schedule'
|
||||||
|
# run: |
|
||||||
|
#
|
||||||
|
# git config --local user.email "action@git.ingolf-wagner.de"
|
||||||
|
# git config --local user.name "Forgejo Action"
|
||||||
|
#
|
||||||
|
# git diff --quiet && \
|
||||||
|
# git diff --staged --quiet || \
|
||||||
|
# (git commit -am "Update Nix flakes" && git push)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue