simplify workflow for codeberg pages
1 file changed, 9 insertions(+), 31 deletions(-)
changed files
M .forgejo/workflows/zola.yaml → .forgejo/workflows/zola.yaml
@@ -2,6 +2,10 @@ name: Deploy Zola site to Pages env: ZOLA_VERSION: 0.21.0 + # This workflow will only work correctly in https://codeberg.org/alinnow/zola-bearblog.git. + # Adjust the site name to match your user and repository name. To publish + # to the index site, https://username.codeberg.page/, name your repository `pages`. + PAGES_URL: https://alinnow.codeberg.page/zola-bearblog on: # Runs on pushes targeting the default branch@@ -13,7 +17,7 @@ # Allows you to run this workflow manually from the Actions tab workflow_dispatch: jobs: - build: + publish: # You can find the list of available runners on https://codeberg.org/actions/meta, or run one yourself. runs-on: codeberg-tiny-lazy container:@@ -31,34 +35,8 @@ fetch-depth: 0 - name: Generate static files with Zola run: | zola build - - name: Upload generated files - uses: https://code.forgejo.org/actions/upload-artifact@v3 - with: - name: Generated files - path: public/ - - deploy: - needs: [build] - runs-on: codeberg-tiny-lazy - steps: - - name: Clone the repository - uses: https://code.forgejo.org/actions/checkout@v5 - with: - submodules: recursive - fetch-depth: 0 - - name: Checkout the target branch and clean it up - # If you want to commit to a branch other than "pages", change the two references below, as well as the reference in the last step. - run: | - git checkout pages || git switch --orphan pages && \ - rm -Rfv $(ls -A | egrep -v '^(\.git|LICENSE)$') - - name: Download generated files - uses: https://code.forgejo.org/actions/download-artifact@v3 + - uses: actions/git-pages@v2 with: - name: Generated files - - name: Publish the website - run: | - git config user.email codeberg-ci && \ - git config user.name "Codeberg CI" && \ - git add . && \ - git commit --allow-empty --message "Codeberg build for ${GITHUB_SHA}" && \ - git push origin pages + site: ${{ env.PAGES_URL }} + token: ${{ forge.token }} + source: public