vanity/.forgejo/workflows/deploy.yaml
Julia Johannesen 388a559b5a
Some checks failed
Deploy / deploy (push) Failing after 34s
Fixies :3
2026-08-17 19:58:54 -04:00

56 lines
1.6 KiB
YAML

name: Deploy
on:
push:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
deploy:
runs-on: docker
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Clone open-feature/go-vanityurls
run: git clone https://github.com/open-feature/go-vanityurls
- name: Generate HTML
run: |
cd go-vanityurls
ln -sf ../vanity.yaml ./vanity.yaml
go run main.go
- name: Upload HTML
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
run: |
apt update && apt install -y expect rclone
mkdir ~/.ssh
cat > ~/.ssh/id_ed25519.pub <<< $SSH_PUBLIC_KEY
cat > ~/.ssh/id_ed25519 <<< $SSH_PRIVATE_KEY
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
mkdir ~/.config/rclone
cat > ~/.config/rclone/rclone.conf <<< $'[bridget]\ntype = sftp\nhost = bridget.arimelody.space\nport = 40195\nuser = vanity'
eval `ssh-agent`
expect <<-EOF
spawn ssh-add /root/.ssh/id_ed25519
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
rclone sync --delete-during -vv ./go-vanity/public bridget:/var/www/vanity