-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4e49beb
Showing
10 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Sample workflow for building and deploying a Jekyll site to GitHub Pages | ||
name: Deploy Jekyll with GitHub Pages dependencies preinstalled | ||
|
||
on: | ||
# Runs on pushes targeting the default branch | ||
push: | ||
branches: ["main"] | ||
paths-ignore: | ||
- 'zones/**' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
# Build job | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v3 | ||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./ | ||
destination: ./_site | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v2 | ||
|
||
# Deployment job | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Update DNS | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'zones/**' | ||
|
||
|
||
jobs: | ||
depoly: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 5 | ||
|
||
- name: Run a multi-line script | ||
run: | | ||
export CF_API_EMAIL=${{ secrets.CF_API_EMAIL }} | ||
export CF_API_KEY=${{ secrets.CF_API_KEY }} | ||
bash install-flarectl.sh | ||
bash depoly.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.vscode | ||
flarectl |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
biu-x.org |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# `biu-x.org`子域名申请 | ||
## 申请流程 | ||
|
||
- Fork 本项目 | ||
- 域名信息添加 | ||
在项目下[zones](./zones)的`biu-x.org`下,按照`#NAME, TYPE, CONTENT`格式添加,一行一条记录 | ||
- 提交 Pull Request | ||
- 等待审核,确认后部署 | ||
|
||
## 鸣谢 | ||
|
||
感谢 [Cloudflare](https://www.cloudflare.com/) 提供的优质 DNS 服务及相关服务。 | ||
|
||
感谢 [Vercel](https://vercel.com) 提供优质的主机服务。 | ||
|
||
感谢 [XuPeiYao](https://github.com/XuPeiYao/cloudflare-dns-update-sample) 提供的脚本。 | ||
|
||
如果您对本项目感兴趣,可以通过以下方式支持我: | ||
|
||
- 关注我的 Github 账号:[@hiifong](https://github.com/hiifong) [![github](https://img.shields.io/github/followers/hiifong.svg?style=social&label=Followers)](https://github.com/hiifong) | ||
- 扫码打赏 | ||
- 微信 | ||
<img src="./WeChat.png" width="200px" height="200px" /> | ||
- 支付宝 | ||
<img src="./Alipay.jpg" width="200px" height="200px" /> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
# list all zones | ||
for zone in $(ls ./zones) | ||
do | ||
# Delete domain | ||
# Ignore all config line starting with '#' | ||
while IFS=, read -r name type content | ||
do [[ $name =~ (^#.*) ]] && continue | ||
name="$(echo -e "${name}" | tr -d '[[:space:]]')" | ||
type="$(echo -e "${type}" | tr -d '[[:space:]]')" | ||
content="$(echo -e "${content}" | tr -d '[[:space:]]')" | ||
|
||
if [ "$name" = "" ] | ||
then | ||
continue | ||
fi | ||
|
||
while IFS="|" read -r id type name content proxied ttl | ||
do | ||
id="$(echo -e "${id}" | tr -d '[[:space:]]')" | ||
echo Remove $id $name | ||
./flarectl dns delete --zone=$zone --id=$id | ||
done < <(./flarectl dns list --zone $zone --name $name.$zone --type $type | grep -P "\s*[a-z0-9]+"); | ||
done < <(git --no-pager diff --ignore-space-at-eol HEAD~1 -- ./zones/$zone | grep -P "^[\-]([^,]+,){2}[^,]+" | cut -c 2-); | ||
|
||
# Add domain | ||
# Ignore all config line starting with '#' | ||
while IFS=, read -r name type content | ||
do [[ $name =~ (^#.*) ]] && continue | ||
name="$(echo -e "${name}" | tr -d '[[:space:]]')" | ||
type="$(echo -e "${type}" | tr -d '[[:space:]]')" | ||
content="$(echo -e "${content}" | tr -d '[[:space:]]')" | ||
|
||
if [ "$name" = "" ] | ||
then | ||
continue | ||
fi | ||
|
||
./flarectl dns create-or-update --zone=$zone --name=$name --content=$content --type=$type; | ||
done < <(git --no-pager diff --ignore-space-at-eol HEAD~1 -- ./zones/$zone | grep -P "^[\+]([^,]+,){2}[^,]+" | cut -c 2-); | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
wget https://github.com/cloudflare/cloudflare-go/releases/download/v0.45.0/flarectl_0.45.0_linux_amd64.tar.xz | ||
tar -xf flarectl_0.45.0_linux_amd64.tar.xz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#NAME, TYPE, CONTENT | ||
hiifong,CNAME,cname.vercel-dns.com |