44 lines
1.4 KiB
YAML
Raw Normal View History

name: Build
on:
push:
branches:
- v4
jobs:
build:
2024-02-05 00:24:25 +09:00
env:
RUNNER_TOOL_CACHE: /toolcache
runs-on: ubuntu-latest
steps:
- run: git config --global core.quotepath false
2024-02-05 00:09:38 +09:00
- name: Install apt packages
run: apt update && apt install -y rsync
- uses: actions/checkout@v3
with:
fetch-depth: 0
2024-02-04 23:56:14 +09:00
- uses: https://github.com/actions/setup-node@v4
with:
2024-02-05 00:02:21 +09:00
node-version: 'latest'
2024-02-05 02:04:55 +09:00
- uses: https://github.com/actions/setup-go@v4
2024-02-05 02:08:02 +09:00
with:
go-version: '^1.20'
2024-02-05 01:56:10 +09:00
- uses: https://gitea.com/actions/go-hashfiles@v0.0.1
2024-02-05 01:53:16 +09:00
id: get-hash
with:
patterns: |-
**/package-lock.json
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ steps.get-hash.outputs.hash }}
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: npx quartz build
2024-02-04 23:27:18 +09:00
- name: Create private key
run: |
echo "${{ secrets.PRIVATE_KEY }}" > /tmp/act_runner_key
chmod 600 /tmp/act_runner_key
- name: rsync public directory
run: |
2024-02-05 00:33:11 +09:00
rsync -avz --delete -e "ssh -i /tmp/act_runner_key -o StrictHostKeyChecking=no -p ${{ vars.WEBSERVER_PORT }}" ${{ gitea.workspace }}/public/* ${{ vars.WEBSERVER_USER }}@${{ vars.WEBSERVER_HOST }}:/var/www/html