-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (56 loc) · 2.21 KB
/
debug.yml
File metadata and controls
64 lines (56 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Github Server
on:
workflow_dispatch:
inputs:
os:
description: 'Operating System'
required: true
default: 'ubuntu-latest'
type: choice
options:
- ubuntu-latest
- macos-latest
- ubuntu-24.04-arm
jobs:
CI:
runs-on: ${{ inputs.os }}
steps:
- run: |
mkdir -m 0755 -p ~/.ssh
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMpaY3LyCW4HHqbp4SA4tnA+1Bkgwrtro2s/DEsBcPDe" > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
# macOS ~/.ssh/config
cat > ~/.ssh/ssh_config <<EOF
Host github.com
User git
IdentityFile ~/.ssh/id_ed25519
EOF
- uses: actions/checkout@master
- uses: DeterminateSystems/nix-installer-action@main
# ssh
- run: |
if [ ${{ inputs.os }} == "ubuntu-latest" ]; then
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb
sudo dpkg -i cloudflared.deb
elif [ ${{ inputs.os }} == "ubuntu-24.04-arm" ]; then
curl -L --output cloudflared.deb https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-arm64.deb
sudo dpkg -i cloudflared.deb
else
brew install cloudflared
sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
nix run --extra-experimental-features "nix-command flakes" nix-darwin -- switch --flake /Users/runner/work/flake/flake#github-action-darwin
sudo chsh -s /run/current-system/sw/bin/fish runner
fi
cloudflared --no-autoupdate tunnel run --token ${{ secrets.CLOUDFLARED_TUNNEL }} &
# extra settings
# github workflow do not support alias, use symlink instead
# - run: |
# if [ ${{ inputs.os }} == "ubuntu-latest" ]; then
# nix run .#homeConfigurations.github-action.activationPackage
# mkdir -p ~/.local/bin/ && ln -s ~/.nix-profile/bin/yazi ~/.local/bin/r
# else
# echo "macOS"
# fi
- run: sleep 72000