From e079cc0bba7a629e7d35e56077fedc7d4b1e40df Mon Sep 17 00:00:00 2001 From: Ouyang Chunhui Date: Mon, 23 Dec 2024 00:08:40 +0800 Subject: [PATCH] upgrade github actions Signed-off-by: Ouyang Chunhui --- .github/workflows/grav_auto_deploy.yaml | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/grav_auto_deploy.yaml diff --git a/.github/workflows/grav_auto_deploy.yaml b/.github/workflows/grav_auto_deploy.yaml new file mode 100644 index 000000000..612568a4f --- /dev/null +++ b/.github/workflows/grav_auto_deploy.yaml @@ -0,0 +1,29 @@ +name: Hexo automatic deployment + +on: + push: + branches: + - main + +jobs: + hexo_deploy: + name: Grav automatic deployment + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v3 + with: + node-version: 20.17.0 + - name: LXD deployment environment initialization + run: | + sudo snap install lxd + sudo lxd init --auto + sudo lxc remote add deploy direct.qhjack.top --password ${{secrets.LXD_PASSWORD}} --accept-certificate + sudo lxc remote switch deploy + - name: clear LXD cache + run: | + sudo lxc exec qhjack /usr/bin/clean_qhjack_web.fish + - name: Upload files to LXD on direct.qhjack.top + run: | + cp -r * ../qhjack + sudo lxc file push -p -r ../qhjack qhjack/var/www/