ci: Upgrade zola #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: Build and deploy the site | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
env: | |
REPOSITORY: ${{ github.repository }} | |
run: | | |
ls -la | |
git clone "https://github.com/$REPOSITORY" . | |
- name: Download Zola | |
run: | | |
version='v0.18.0' | |
archive="zola-${version}-x86_64-unknown-linux-gnu.tar.gz" | |
curl -L "https://github.com/getzola/zola/releases/download/${version}/${archive}" -o "$archive" | |
tar xf "$archive" | |
- name: Build the site | |
run: | | |
./zola build | |
- name: Deploy the site | |
working-directory: ./public | |
env: | |
DEPLOY_SECRET_KEY: ${{ secrets.DEPLOY_SECRET_KEY }} | |
run: | | |
mkdir ~/.ssh | |
echo "$DEPLOY_SECRET_KEY" > ~/.ssh/id_ed25519 | |
chmod 600 ~/.ssh/id_ed25519 | |
echo 'Host *' >> ~/.ssh/config | |
echo ' StrictHostKeyChecking=no' >> ~/.ssh/config | |
git config --global user.email "[email protected]" | |
git config --global user.name "CI" | |
git init -b built | |
git add -A | |
git commit -m "Add files generated by zola" | |
git push -f [email protected]:ruma/ruma.dev built |