parent
fa2c7aa0d7
commit
e7f40e0704
1 changed files with 16 additions and 14 deletions
|
|
@ -17,7 +17,7 @@ concurrency:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: docker
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v6
|
uses: actions/checkout@v6
|
||||||
|
|
@ -30,25 +30,27 @@ jobs:
|
||||||
- name: Generate HTML
|
- name: Generate HTML
|
||||||
run: |
|
run: |
|
||||||
cd go-vanityurls
|
cd go-vanityurls
|
||||||
ln -s ../yanity.yaml ./vanity.yaml
|
ln -sf ../vanity.yaml ./vanity.yaml
|
||||||
go run main.go
|
go run main.go
|
||||||
- name: Install rclone
|
- name: Upload HTML
|
||||||
run: apt install rclone
|
|
||||||
- name: Configure rclone
|
|
||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
|
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
|
||||||
|
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
|
apt update && apt install -y expect rclone
|
||||||
mkdir ~/.ssh
|
mkdir ~/.ssh
|
||||||
cat < ~/.ssh/id_ed25519.pub <<< $SSH_PUBLIC_KEY
|
cat > ~/.ssh/id_ed25519.pub <<< $SSH_PUBLIC_KEY
|
||||||
cat < ~/.ssh/id_ed25519 <<< $SSH_PRIVATE_KEY
|
cat > ~/.ssh/id_ed25519 <<< $SSH_PRIVATE_KEY
|
||||||
|
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
|
||||||
mkdir ~/.config/rclone
|
mkdir ~/.config/rclone
|
||||||
cat < ~/.config/rclone/config.conf <<<-EOF
|
cat > ~/.config/rclone/rclone.conf <<< $'[bridget]\ntype = sftp\nhost = bridget.arimelody.space\nport = 40195\nuser = vanity'
|
||||||
[bridget]
|
eval `ssh-agent`
|
||||||
type = sftp
|
expect <<-EOF
|
||||||
host = bridget
|
spawn ssh-add /home/root/.ssh/id_ed25519
|
||||||
user = www-data
|
expect "Enter passphrase for /root/.ssh/id_ed25519:"
|
||||||
|
send "$SSH_PASSWORD\n";
|
||||||
|
expect "Identity added: /root/.ssh/id_ed25519 (/root/.ssh/id_rsa)"
|
||||||
|
interact
|
||||||
EOF
|
EOF
|
||||||
- name: Upload HTML
|
|
||||||
run: |
|
|
||||||
rclone sync --delete-during -vv ./go-vanity/public bridget:/var/www/vanity
|
rclone sync --delete-during -vv ./go-vanity/public bridget:/var/www/vanity
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue