Skip to content

Commit

Permalink
Switch to branch-less GitHub pages workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Mar 22, 2024
1 parent d123a1a commit 039dcd3
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
name: Build

on:
push:
branches:
- main

jobs:
deploy:
name: Build and deploy the site
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write

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
- 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
echo 'Host *' >> ~/.ssh/config
echo ' StrictHostKeyChecking=no' >> ~/.ssh/config
- name: Upload pages artifact
uses: actions/upload-pages-artifact@v1
with:
path: public

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
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v2

0 comments on commit 039dcd3

Please sign in to comment.