Skip to content

.github: unfuck the pipeline #79

.github: unfuck the pipeline

.github: unfuck the pipeline #79

Workflow file for this run

on: [push]
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy blog to hydrogen
if: github.ref == 'refs/heads/main'
env:
MACHINE: hydrogen
steps:
- name: Setup Go 1.19
id: go
uses: actions/setup-go@v2
- name: Setup Tailscale
id: tailscale
uses: tailscale/github-action@v2
with:
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
oauth-secret: ${{ secrets.TS_OAUTH_CLIENT_SECRET }}
tags: tag:public
- name: Add SSH key
id: ssh
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |

Check failure on line 25 in .github/workflows/main.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/main.yml

Invalid workflow file

You have an error in your yaml syntax on line 25
set -euxo pipefail
tailscale ping -c 2 $(tailscale ip -4 $MACHINE)
mkdir -p ~/.ssh
ssh-keyscan $(tailscale ip -4 $MACHINE) > ~/.ssh/known_hosts
printf "%s" "$SSH_KEY" > ~/.ssh/key
chmod 600 ~/.ssh/key
- name: Fetch code
id: fetch
uses: actions/checkout@v1
- name: Compile blog binary
id: compile
run: go build -o prose ./cmd/prose
- name: Build tarball and ship it
id: tarball
run: |
TIME=$(date +%Y%m%d-%H%M%S)
FILENAME=prose-${TIME}.tar.gz
mkdir -p static/css
tar -czf $FILENAME prose static/ styles/ templates/ posts/
echo $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
scp -i ~/.ssh/key $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "tar -C /var/www/blog -xzf ~/$FILENAME"
ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "sudo systemctl restart prose"