.github: unfuck the pipeline
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
21cfef64fe
commit
3a986d4769
1 changed files with 8 additions and 9 deletions
17
.github/workflows/main.yml
vendored
17
.github/workflows/main.yml
vendored
|
@ -11,8 +11,6 @@ jobs:
|
||||||
- name: Setup Go 1.19
|
- name: Setup Go 1.19
|
||||||
id: go
|
id: go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v2
|
||||||
with:
|
|
||||||
go-version: '1.19.3'
|
|
||||||
- name: Setup Tailscale
|
- name: Setup Tailscale
|
||||||
id: tailscale
|
id: tailscale
|
||||||
uses: tailscale/github-action@v2
|
uses: tailscale/github-action@v2
|
||||||
|
@ -26,8 +24,9 @@ jobs:
|
||||||
SSH_KEY: ${{ secrets.SSH_KEY }}
|
SSH_KEY: ${{ secrets.SSH_KEY }}
|
||||||
run: |
|
run: |
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
tailscale ping -c 2 $MACHINE
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
ssh-keyscan $(tailscale ip -4 $MACHINE) > ~/.ssh/known_hosts
|
ssh-keyscan $MACHINE > ~/.ssh/known_hosts
|
||||||
printf "%s" "$SSH_KEY" > ~/.ssh/key
|
printf "%s" "$SSH_KEY" > ~/.ssh/key
|
||||||
chmod 600 ~/.ssh/key
|
chmod 600 ~/.ssh/key
|
||||||
|
|
||||||
|
@ -37,7 +36,7 @@ jobs:
|
||||||
|
|
||||||
- name: Compile blog binary
|
- name: Compile blog binary
|
||||||
id: compile
|
id: compile
|
||||||
run: go build -o prose .
|
run: go build -o prose ./cmd/prose
|
||||||
|
|
||||||
- name: Build tarball and ship it
|
- name: Build tarball and ship it
|
||||||
id: tarball
|
id: tarball
|
||||||
|
@ -45,8 +44,8 @@ jobs:
|
||||||
TIME=$(date +%Y%m%d-%H%M%S)
|
TIME=$(date +%Y%m%d-%H%M%S)
|
||||||
FILENAME=prose-${TIME}.tar.gz
|
FILENAME=prose-${TIME}.tar.gz
|
||||||
mkdir -p static/css
|
mkdir -p static/css
|
||||||
tar -czf $FILENAME prose fonts/ static/ styles/ templates/ posts/
|
tar -czf $FILENAME prose static/ styles/ templates/ posts/
|
||||||
echo $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
|
echo $FILENAME "github@$MACHINE:/home/github/"
|
||||||
scp -i ~/.ssh/key $FILENAME "github@$(tailscale ip -4 $MACHINE):/home/github/"
|
scp -i ~/.ssh/key $FILENAME "github@$MACHINE:/home/github/"
|
||||||
ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "tar -C /var/www/blog -xzf ~/$FILENAME"
|
ssh -i ~/.ssh/key "github@$MACHINE" "tar -C /var/www/blog -xzf ~/$FILENAME"
|
||||||
ssh -i ~/.ssh/key "github@$(tailscale ip -4 $MACHINE)" "sudo systemctl restart prose"
|
ssh -i ~/.ssh/key "github@$MACHINE" "sudo systemctl restart prose"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue