diff --git a/.gitea/workflows/build_and_deploy.yaml b/.gitea/workflows/build_and_deploy.yaml new file mode 100644 index 0000000..a37637b --- /dev/null +++ b/.gitea/workflows/build_and_deploy.yaml @@ -0,0 +1,32 @@ +name: Build and deploy site +run-name: ${{ gitea.actor }} is building and deploying the static page +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Checkout repo + uses: RouxAntoine/checkout@v3.5.4 + with: + submodules: 'recursive' + - name: Install packages + run: apt update && apt install -y jq rsync + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.123.8' + extended: true + - name: Build site + run: hugo --minify + - name: Deploy + run: | + echo "${{ secrets.ACT_RUNNER_KEY }}" > /tmp/act_runner_key + chmod 600 /tmp/act_runner_key + rsync -avz --delete -e "ssh -i /tmp/act_runner_key -o StrictHostKeyChecking=no" ${{ gitea.workspace }}/public/* root@jayrude.dev:/var/lib/docker/volumes/swag_swag/_data/www + - run: echo "This job's status is ${{ job.status }}." \ No newline at end of file