First time deployment with pages and dns update
This commit is contained in:
60
.gitea/workflows/jekyll-pages.yml
Normal file
60
.gitea/workflows/jekyll-pages.yml
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Deploy Jekyll site to Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
env:
|
||||
RUBY_VERSION: "3.3.5"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: checkout pages
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: 'pages'
|
||||
path: 'pages'
|
||||
- name: Setup Ruby
|
||||
run: |
|
||||
apt-get update && \
|
||||
apt-get install curl wget tar build-essential zlib1g-dev gpg -y && \
|
||||
curl -sSL https://rvm.io/mpapis.asc | gpg --import - && \
|
||||
curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - && \
|
||||
curl -sSL https://get.rvm.io | bash -s stable && \
|
||||
source /etc/profile.d/rvm.sh && \
|
||||
rvm mount -r https://raw.morlana.space/morlana/rvm-binaries/@binaries/ubuntu/22.04/aarch64/ruby-$RUBY_VERSION.tar.bz2 && \
|
||||
rvm use $RUBY_VERSION && ruby -v && gem -v && \
|
||||
gem install bundler jekyll webrick
|
||||
- name: Build with Jekyll
|
||||
run: |
|
||||
source /etc/profile.d/rvm.sh && \
|
||||
rvm use $RUBY_VERSION && ruby -v && gem -v && \
|
||||
mv README.md index.md && \
|
||||
bundle install && \
|
||||
bundle exec jekyll build --destination pages
|
||||
env:
|
||||
JEKYLL_ENV: production
|
||||
- name: push pages
|
||||
run: |
|
||||
cd pages && \
|
||||
cp ../.domains ./.domains && \
|
||||
git config user.name "${{ gitea.actor }}" && \
|
||||
git config user.email ""${{ gitea.actor }}"@noreply.git.morlana.online" && \
|
||||
git add . && \
|
||||
git commit -m "jekyll build from Action ${GITHUB_SHA}" && \
|
||||
git push
|
||||
26
.gitea/workflows/update-dns.yml
Normal file
26
.gitea/workflows/update-dns.yml
Normal file
@@ -0,0 +1,26 @@
|
||||
name: Update Cloudflare DNS
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
concurrency:
|
||||
group: "cloudflare"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
update-dns:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: pip install pyyaml requests
|
||||
|
||||
- name: Update Cloudflare DNS
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
|
||||
run: python update_cloudflare_dns.py
|
||||
Reference in New Issue
Block a user