Update workflows
All checks were successful
update-flake-lock / update-flake-lock (push) Successful in 59m30s
All checks were successful
update-flake-lock / update-flake-lock (push) Successful in 59m30s
This commit is contained in:
parent
96e6da10a4
commit
3a500a1d9b
2 changed files with 82 additions and 38 deletions
|
@ -9,7 +9,7 @@ jobs:
|
||||||
deploy-rs:
|
deploy-rs:
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu
|
||||||
container:
|
container:
|
||||||
image: ubuntu:23.10
|
image: ubuntu:24.04
|
||||||
options: --mount type=bind,src=/dev/net/tun,dst=/dev/net/tun --privileged
|
options: --mount type=bind,src=/dev/net/tun,dst=/dev/net/tun --privileged
|
||||||
steps:
|
steps:
|
||||||
- name: "Runner: Info"
|
- name: "Runner: Info"
|
||||||
|
@ -28,7 +28,7 @@ jobs:
|
||||||
- name: "Setup: Runner"
|
- name: "Setup: Runner"
|
||||||
run: |
|
run: |
|
||||||
apt update -y
|
apt update -y
|
||||||
apt install git nodejs nix-bin sudo sudo curl -y
|
apt install git nodejs nix-bin sudo curl -y
|
||||||
git config --global user.email "${{github.actor}}"
|
git config --global user.email "${{github.actor}}"
|
||||||
git config --global user.name "Forgejo Runner"
|
git config --global user.name "Forgejo Runner"
|
||||||
echo "100.64.0.14 gotify.sysctl.io" >> /etc/hosts
|
echo "100.64.0.14 gotify.sysctl.io" >> /etc/hosts
|
||||||
|
@ -50,8 +50,6 @@ jobs:
|
||||||
chmod 700 /root/.ssh
|
chmod 700 /root/.ssh
|
||||||
chmod 600 /root/.ssh/id_ed25519
|
chmod 600 /root/.ssh/id_ed25519
|
||||||
chmod 644 /root/.ssh/id_ed25519.pub
|
chmod 644 /root/.ssh/id_ed25519.pub
|
||||||
echo "Public Key: "
|
|
||||||
cat /root/.ssh/id_ed25519.pub
|
|
||||||
|
|
||||||
- name: "Setup: Headscale Network"
|
- name: "Setup: Headscale Network"
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -11,49 +11,95 @@ jobs:
|
||||||
runs-on: ubuntu
|
runs-on: ubuntu
|
||||||
container:
|
container:
|
||||||
image: ubuntu:24.04
|
image: ubuntu:24.04
|
||||||
|
options: --mount type=bind,src=/dev/net/tun,dst=/dev/net/tun --privileged
|
||||||
steps:
|
steps:
|
||||||
- name: "Setup Runner"
|
- name: "Runner: Info"
|
||||||
run: |
|
|
||||||
apt update -y
|
|
||||||
apt install git nodejs nix-bin qemu-utils qemu-system-arm qemu-user-binfmt -y
|
|
||||||
git config --global user.email "${{github.actor}}"
|
|
||||||
git config --global user.name "Forgejo Runner"
|
|
||||||
echo "100.64.0.14 gotify.sysctl.io" >> /etc/hosts
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: "Directory Structure"
|
|
||||||
run: |
|
|
||||||
ls ${{ github.workspace }}/*
|
|
||||||
- name: "Git Info"
|
|
||||||
run: |
|
|
||||||
git -C ${{ github.workspace }} status
|
|
||||||
git -C ${{ github.workspace }} log
|
|
||||||
git -C ${{ github.workspace }} diff
|
|
||||||
- name: "Runner: Node Info"
|
|
||||||
run: |
|
run: |
|
||||||
|
set -x
|
||||||
|
pwd
|
||||||
|
ls -lah
|
||||||
id
|
id
|
||||||
uname -a
|
uname -a
|
||||||
hostname
|
hostname
|
||||||
cat /etc/os-release
|
cat /etc/os-release
|
||||||
- name: "Nix Version"
|
whoami
|
||||||
|
id
|
||||||
|
cat /etc/resolv.conf
|
||||||
|
|
||||||
|
- name: "Setup: Runner"
|
||||||
run: |
|
run: |
|
||||||
nix --version
|
apt update -y
|
||||||
- name: "Nix Flake Update"
|
apt install git nodejs nix-bin sudo curl -y
|
||||||
|
git config --global user.email "${{github.actor}}"
|
||||||
|
git config --global user.name "Forgejo Runner"
|
||||||
|
echo "100.64.0.14 gotify.sysctl.io" >> /etc/hosts
|
||||||
|
|
||||||
|
- name: "Setup: Tailscale Repo"
|
||||||
run: |
|
run: |
|
||||||
echo "Running Nix Flake Update"
|
mkdir -p --mode=0755 /usr/share/keyrings
|
||||||
cd /workspace/albert/nix
|
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/lunar.noarmor.gpg | sudo tee /usr/share/keyrings/tailscale-archive-keyring.gpg >/dev/null
|
||||||
|
curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/lunar.tailscale-keyring.list | sudo tee /etc/apt/sources.list.d/tailscale.list
|
||||||
|
apt update -y
|
||||||
|
apt install tailscale -y
|
||||||
|
|
||||||
|
- name: "Setup: SSH"
|
||||||
|
run: |
|
||||||
|
rm -rf /root/.ssh
|
||||||
|
mkdir /root/.ssh
|
||||||
|
echo "${{ secrets.SSH_PUBLIC_KEY }}" > /root/.ssh/id_ed25519.pub
|
||||||
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > /root/.ssh/id_ed25519
|
||||||
|
chmod 700 /root/.ssh
|
||||||
|
chmod 600 /root/.ssh/id_ed25519
|
||||||
|
chmod 644 /root/.ssh/id_ed25519.pub
|
||||||
|
|
||||||
|
- name: "Setup: Headscale Network"
|
||||||
|
run: |
|
||||||
|
echo "tailscaled --cleanup"
|
||||||
|
sudo tailscaled --cleanup
|
||||||
|
echo ""
|
||||||
|
echo "tailscaled --state=mem 2> ~/tailscaled.log &"
|
||||||
|
sudo tailscaled --state=mem: 2> ~/tailscaled.log &
|
||||||
|
echo ""
|
||||||
|
echo "tailscale up"
|
||||||
|
sudo tailscale up \
|
||||||
|
--login-server=https://headscale.sysctl.io \
|
||||||
|
--accept-routes \
|
||||||
|
--accept-dns \
|
||||||
|
--authkey ${{ secrets.TAILSCALE_KEY }} \
|
||||||
|
--hostname forgejo-runner \
|
||||||
|
--advertise-tags "tag:forgejo,tag:container,tag:ephemeral"
|
||||||
|
sudo tailscale status
|
||||||
|
sudo tailscale netcheck
|
||||||
|
|
||||||
|
|
||||||
|
- name: "SSH and Deploy"
|
||||||
|
run: |
|
||||||
|
ssh -q -A -o StrictHostKeyChecking=no albert@framework-server \
|
||||||
|
"
|
||||||
|
set -x
|
||||||
|
eval (ssh-agent -c)
|
||||||
|
ssh-add
|
||||||
|
env | grep SSH
|
||||||
|
cd /etc/nixos/git
|
||||||
git pull
|
git pull
|
||||||
nix --extra-experimental-features "nix-command flakes" flake update
|
nix flake update
|
||||||
echo "Git Diff:"
|
nix flake check
|
||||||
git diff
|
"
|
||||||
- name: "Nix Flake Check"
|
|
||||||
run: |
|
|
||||||
echo "Running Nix Flake Check"
|
|
||||||
cd /workspace/albert/nix
|
|
||||||
nix --extra-experimental-features "nix-command flakes" flake check
|
|
||||||
- if: success()
|
- if: success()
|
||||||
|
name: "Sucess: Git Commit & Push"
|
||||||
run: |
|
run: |
|
||||||
git commit -am "[ACTIONS] Flake Update (`date +%Y-%m-%d`)"
|
ssh -q -A -o StrictHostKeyChecking=no albert@framework-server \
|
||||||
|
"
|
||||||
|
set -x
|
||||||
|
eval (ssh-agent -c)
|
||||||
|
ssh-add
|
||||||
|
env | grep SSH
|
||||||
|
cd /etc/nixos/git
|
||||||
|
git commit -am '[ACTIONS] Flake Update (`date +%Y-%m-%d`)'
|
||||||
git push
|
git push
|
||||||
|
"
|
||||||
|
|
||||||
- if: success()
|
- if: success()
|
||||||
uses: https://git.sysctl.io/actions/gotify-action@master
|
uses: https://git.sysctl.io/actions/gotify-action@master
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in a new issue