如何将你的Fuwari博客部署到Codeberg Pages (Forgejo Actions版)
371 字
2 分钟
如何将你的Fuwari博客部署到Codeberg Pages (Forgejo Actions版)
Codeberg Pages 是 Codeberg 官方提供的一个静态网站托管平台,类似于 Github Pages.
今天我们就要将Fuwari博客部署到Codeberg Pages , 使用 Forgejo Actions。
首先,在仓库中点击设置,点击仓库功能 / 概览,打开 Actions,保存设置。
接下来,回到仓库,在仓库根目录新建.forgejo/workflows文件夹.
在文件夹中添加 astro.yml 文件,内容如下:
name: Deploy Astro site to Pages
on: # Runs on pushes targeting the default branch push: branches: # If you want to build from a different branch, change it here. - main # Allows you to run this workflow manually from the Actions tab workflow_dispatch:
jobs: build: # You can find the list of available runners on https://codeberg.org/actions/meta, or run one yourself. runs-on: codeberg-medium-lazy steps: - name: Clone the repository uses: https://code.forgejo.org/actions/checkout@v4 with: submodules: recursive fetch-depth: 0 - name: check .domains files run: | git ls-files public/.domains ls -la public/ ls -la public/.domains || echo ".domains not found" - name: Setup pnpm uses: pnpm/action-setup@v2 with: version: 10 - name: Setup Node.js uses: https://code.forgejo.org/actions/setup-node@v4 with: node-version: 22 cache: 'pnpm' - name: Install dependencies run: | pnpm install pnpm install @astrojs/sitemap - name: Build Astro site run: pnpm run build
- name: Upload generated files uses: https://code.forgejo.org/actions/upload-artifact@v3 with: name: Generated files path: dist/ include-hidden-files: true
deploy: needs: [ build ] runs-on: codeberg-tiny-lazy steps: - name: Clone the repository uses: https://code.forgejo.org/actions/checkout@v4 with: submodules: recursive fetch-depth: 0
- name: Checkout the target branch and clean it up 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 with: name: Generated files
- name: Publish the website run: | git config user.email codeberg-ci git config user.name "Codeberg CI" echo "=== Files being committed ===" ls -la git add . git commit --allow-empty --message "Codeberg build for ${GITHUB_SHA}" git push origin pages然后,就可以愉快的在Codeberg Pages上部署Fuwari博客了!
支持与分享
如果这篇文章对你有帮助,欢迎分享给更多人或打赏支持!
如何将你的Fuwari博客部署到Codeberg Pages (Forgejo Actions版)
https://clina.top/posts/fuwari-codeberg-pages/相关文章智能推荐
1
为自己的脚本语言编写VSCode支持扩展:从零到发布完整指南
技术本文详细介绍为自定义脚本语言开发VSCode扩展的全过程,涵盖语法高亮、代码片段等基础功能,并指导打包发布与持续维护。
2
隐私政策
日常本隐私政策适用于 Clina 的笔记本(以下简称“我们”)。
3
啥是 CC 协议?
科普本文介绍CC协议(知识共享许可),一种公共版权许可。核心要素包括:BY(署名)、NC(非商业)、ND(禁止修改)、SA(相同方式共享),其中SA与ND互斥。它们可组合成不同协议,如作者使用的CC BY-NC-SA。另有CC0协议,代表放弃版权,作品进入公共领域。
4
对 Fuwari 进行亿些改动(已存档)
改动对 Fuwari 进行的改动总结
5
自由软件之输入法————手机篇
科普本文系统介绍多平台自由输入法:Android 推荐同文(高度定制)、小企鹅(功能丰富)、语燕;iOS 与鸿蒙需侧载安装小企鹅;Linux 桌面环境按常规方式配置。各输入法均提供 GitHub 或 F-Droid 下载链接,满足不同用户对自由输入工具的需求。
随机文章随机推荐











