Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: optimize GitHub Actions workflow for build and deployment #630

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,33 @@ jobs:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true

- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install and Build 🔧
run: |
yarn install
yarn crowdin:sync
yarn build
- name: Build PDF prerequisites 🔨
run: |
sudo apt install fonts-noto -y
Expand All @@ -26,7 +44,7 @@ jobs:
cd prince-14.2-linux-generic-x86_64
yes "" | sudo ./install.sh
# https://github.com/signcl/docusaurus-prince-pdf
# https://github.com/signcl/docusaurus-prince-pdf
- name: Generate PDF 🖨️
run: |
yarn serve > /dev/null &
Expand All @@ -38,6 +56,13 @@ jobs:
rm pdf/*.txt
mv pdf/* build/pdf/ -f
- name: Clean up 🧹
run: |
rm -rf prince-14.2-linux-generic-x86_64*
yarn cache clean
npm cache clean --force
sudo apt-get clean
- name: Upload results 📤
uses: actions/upload-artifact@v3
with:
Expand All @@ -48,7 +73,7 @@ jobs:
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
ssh-key: ${{ secrets.DEPLOY_KEY}}
ssh-key: ${{ secrets.DEPLOY_KEY }}
git-config-name: ${{ secrets.GH_NAME }}
git-config-email: ${{ secrets.GH_EMAIL }}
repository-name: casdoor/casdoor.github.io
Expand Down
Loading