From 7b804d0947b0840ceb7d6ed48555acc8a5478dbc Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 6 Oct 2022 10:46:32 +0200 Subject: [PATCH] New site preview CI job --- .editorconfig | 4 ++++ .github/workflows/zola.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/zola_temp.yml | 21 --------------------- 3 files changed, 37 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/zola.yml delete mode 100644 .github/workflows/zola_temp.yml diff --git a/.editorconfig b/.editorconfig index bc49d523e..09ef5dfca 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,7 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false + +# GitHub workflows +[*.yml] +indent_size = 2 diff --git a/.github/workflows/zola.yml b/.github/workflows/zola.yml new file mode 100644 index 000000000..cd042cfd6 --- /dev/null +++ b/.github/workflows/zola.yml @@ -0,0 +1,33 @@ +name: Build site +on: + push: + branches: + - zola + +jobs: + deploy: + name: Build and deploy the site + runs-on: ubuntu-latest + steps: + - name: Repository checkout + uses: actions/checkout@v2 + + - name: Download Zola + run: | + version='v0.16.1' + 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 + run: | + ./zola build + + - name: Deploy + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: JamesIves/github-pages-deploy-action@4.1.4 + with: + folder: public + repository-name: matrix-org/zola-preview + branch: main + ssh-key: ${{ secrets.ZOLA_DEPLOY_KEY }} diff --git a/.github/workflows/zola_temp.yml b/.github/workflows/zola_temp.yml deleted file mode 100644 index 1e7b3112c..000000000 --- a/.github/workflows/zola_temp.yml +++ /dev/null @@ -1,21 +0,0 @@ -# This is just added to share it while I'm working on it -on: push -name: Build and deploy GH Pages -jobs: - build: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/MTRNord/zola' - steps: - - name: checkout - uses: actions/checkout@v2 - - name: Set twitter secret - run: sed -i "s/%twitter_secret%/$TWITTER_TOKEN/" zola/config.toml - env: - TWITTER_TOKEN: ${{ secrets.TWITTER_TOKEN }} - - name: build_and_deploy - uses: shalzz/zola-deploy-action@v0.16.1 - env: - PAGES_BRANCH: gh-pages - BUILD_DIR: zola - TOKEN: ${{ secrets.GITHUB_TOKEN }} - CHECK_LINKS: true