build(deps): bump actions/checkout from 4.2.0 to 4.2.1 #130
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build and Deploy | |
runs-on: ubuntu-22.04 | |
environment: | |
name: prod | |
url: https://libproxy-db.org/ | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
with: | |
# Need fetch-depth 0, otherwise a shallow-clone will occur, and we | |
# won't have history to use with buildinfo.sh. | |
fetch-depth: 0 | |
- name: Install Hugo | |
env: | |
HUGO_VERSION: 0.124.1 | |
run: | | |
curl \ | |
--silent \ | |
--location \ | |
https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz \ | |
| tar \ | |
--extract \ | |
--gunzip \ | |
--directory=/usr/local/bin \ | |
hugo | |
- name: Build site | |
run: | | |
./buildinfo.sh > data/buildinfo.json | |
hugo | |
- name: Upload site artifact | |
uses: actions/[email protected] | |
with: | |
name: libproxy-db | |
path: public | |
if-no-files-found: error | |
- name: Set up SSH | |
run: | | |
mkdir -p ~/.ssh | |
echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/known_hosts | |
- name: Tailscale | |
uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:ci | |
- name: Deploy site | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
rsync \ | |
--recursive \ | |
--verbose \ | |
--rsh="ssh -l deploy-libproxy -i libproxy-db.org_deploy" \ | |
--copy-links \ | |
--delete \ | |
public/ \ | |
100.77.83.94:/srv/http/libproxy-db.org/ |