diff --git a/.forgejo/workflows/duuni.yaml b/.forgejo/workflows/duuni.yaml new file mode 100644 index 0000000..e7235d8 --- /dev/null +++ b/.forgejo/workflows/duuni.yaml @@ -0,0 +1,38 @@ +name: build +on: + push: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: "install dependencies" + run: apt update && apt install mkdocs mkdocs-material mkdocs-material-extensions + - name: "build & push" + run: mkdocs build + - uses: actions/upload-artifact@v3 + with: + name: site + path: site/ + deploy: + runs-on: ubuntu-latest + if: ${{ startsWith(secrets.SSH_PRIVATE_KEY, '-----BEGIN OPENSSH PRIVATE KEY-----') }} + needs: [build] + steps: + - name: Install dependencies + run: apt-get update && apt-get install --no-install-recommends -y rsync openssh-client + - name: Install SSH key + run: | + set -e + echo -e 'Installing ssh keys...' + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo -e "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_foobar + echo -e "${{ vars.SSH_PUBLIC_KEY }}" > ~/.ssh/id_foobar.pub + echo -e "${{ vars.SSH_PUBLIC_KEY }}" > ~/.ssh/known_hosts + chmod 600 ~/.ssh/* + - uses: actions/download-artifact@v3 + - name: Send built pages to server + run: rsync -rclthv --exclude .git --delete-after site/ ${{ vars.SSH_USER }}@${{ vars.SSH_HOST }}:${{ vars.SSH_PATH }}