diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml new file mode 100644 index 0000000..3be9492 --- /dev/null +++ b/.gitea/workflows/deploy.yml @@ -0,0 +1,28 @@ +name: Deploy cjsatarine.space zola website + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - name: install zola + run: | + wget https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz + tar -xvzf *.tar.gz + + - name: Deploy + run: | + apt update -y && apt-get install -y --no-install-recommends rsync + eval "$(ssh-agent -s)" + ssh-add - <<< "${SSH_PRIVATE_KEY}" + mkdir -p ~/.ssh/ + ssh-keyscan -H ${HOST} >> ~/.ssh/known_hosts + rsync -r --delete-after public/* "${SSH_USERNAME}@${HOST}:${HOST_DIR}" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml deleted file mode 100644 index 6fd097f..0000000 --- a/.github/workflows/main.yml +++ /dev/null @@ -1,19 +0,0 @@ -# On every push this script is executed -on: push -name: Build and deploy GH Pages -jobs: - build: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - steps: - - name: checkout - uses: actions/checkout@v4 - - name: build_and_deploy - uses: shalzz/zola-deploy-action@master - env: - # Target branch - PAGES_BRANCH: gh-pages - # Provide personal access token - #TOKEN: ${{ secrets.TOKEN }} - # Or if publishing to the same repo, use the automatic token - TOKEN: ${{ secrets.GITHUB_TOKEN }}