Skip to content

Commit

Permalink
Merge branch 'cloudflare' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
alerezaaa authored Dec 12, 2024
2 parents c5101be + 09689d7 commit 2d163a2
Show file tree
Hide file tree
Showing 363 changed files with 113,134 additions and 4,597 deletions.
42 changes: 37 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ name: Deploy site
on:
push:
branches:
- master
- main
- beta
- cloudflare
- github
paths:
- "assets/**"
- "**.bib"
Expand All @@ -22,6 +23,7 @@ on:
- "!.github/workflows/docker-slim.yml"
- "!.github/workflows/lighthouse-badger.yml"
- "!.github/workflows/prettier.yml"
- "!.github/workflows/firebase-hosting-deploy.yml"
- "!lighthouse_results/**"
- "!CONTRIBUTING.md"
- "!CUSTOMIZE.md"
Expand All @@ -30,8 +32,8 @@ on:
- "!README.md"
pull_request:
branches:
- master
- main
- cloudflare
- github
paths:
- "assets/**"
- "**.bib"
Expand All @@ -55,16 +57,27 @@ on:
- "!FAQ.md"
- "!INSTALL.md"
- "!README.md"

workflow_run:
workflows: [Build Notion Posts]
types:
- completed
workflow_dispatch:

permissions:
contents: write

concurrency:
group: "deploy"
cancel-in-progress: true


jobs:
deploy:
# available images: https://github.com/actions/runner-images#available-images
runs-on: ubuntu-latest
steps:

- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Ruby 💎
Expand All @@ -77,24 +90,43 @@ jobs:
with:
python-version: "3.13"
cache: "pip" # caching pip dependencies

- name: Update _config.yml ⚙️
uses: fjogeleit/yaml-update-action@main
with:
commitChange: false
valueFile: "_config.yml"
propertyPath: "giscus.repo"
value: ${{ github.repository }}

- name: Install and Build 🔧
run: |
pip3 install --upgrade nbconvert
export JEKYLL_ENV=production
bundle exec jekyll build
bundle exec jekyll build --lsi
- name: Purge unused CSS 🧹
run: |
npm install -g purgecss
purgecss -c purgecss.config.js
- name: Add Links page submodule
run: |
git submodule add -f https://github.com/alerezaaa/littlelink _site/links
- name: Deploy 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: _site
branch: cf-pages


### deploy to firebase

- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ALIREZA_ACCA7 }}'
channelId: live
projectId: alireza-acca7
52 changes: 52 additions & 0 deletions .github/workflows/firebase-hosting-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Deploy to Firebase Hosting

on:
# push:
# branches:
# - cloudflare # Change this to your desired branch
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
bundler-cache: true
- name: Update _config.yml ⚙️
uses: fjogeleit/yaml-update-action@main
with:
commitChange: false
valueFile: "_config.yml"
propertyPath: "giscus.repo"
value: ${{ github.repository }}
- name: Install and Build 🔧
run: |
pip3 install --upgrade jupyter
export JEKYLL_ENV=production
bundle exec jekyll build --lsi
- name: Purge unused CSS 🧹
run: |
npm install -g purgecss
purgecss -c purgecss.config.js
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install Firebase CLI
run: npm install -g firebase-tools


- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_ALIREZA_ACCA7 }}'
channelId: live
projectId: alireza-acca7
32 changes: 32 additions & 0 deletions .github/workflows/notion-md-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Notion Posts

on:
# schedule:
# - cron: "*/30 * * * *"

push:
branches: [ "npm-notion" ]
# pull_request:
# branches: [ "note" ]

workflow_dispatch:


jobs:
build_posts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Run a multi-line script
run: |
touch .env
echo 'NOTION_TOKEN=${{ secrets.NOTION_TOKEN }}' >> .env
echo 'NOTION_DATABASE_ID=${{ secrets.NOTION_DATABASE_ID }}' >> .env
yarn
yarn start
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: build pages from notion
25 changes: 25 additions & 0 deletions .github/workflows/w9jds_firebase-action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: deploy_to_firebase_hosting

on:
push:
branches:
- "cf-pages"
workflow_dispatch:
# tags:
# - release-production-*

jobs:
deploy_to_firebase_hosting:

runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@master

- name: Deploy to Firebase
uses: w9jds/firebase-action@master
with:
args: deploy --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Gemfile.lock
assets/libs/
node_modules/
vendor
.idea
notion.js
package.json
.idea
Loading

0 comments on commit 2d163a2

Please sign in to comment.