Skip to content

Commit

Permalink
Fix potential github action smells (#3826)
Browse files Browse the repository at this point in the history
- Avoid running CI related actions when no source code has changed
- Steps should only perform a single command
- Avoid deploying jobs on forks
  • Loading branch information
ceddy4395 committed May 28, 2024
1 parent 7a3cefd commit a6dc56d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
# Runs on pushes targeting the main branch
push:
branches: [main]
paths:
- webiste/**

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down Expand Up @@ -45,14 +47,17 @@ jobs:
- name: Build
run: npm run build
- name: Install website dependencies
run: cd website && npm ci
working-directory: website
run: npm ci
- name: Sync Crowdin
run: cd website && npm run crowdin:sync
working-directory: website
run: npm run crowdin:sync
continue-on-error: true
env:
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
- name: Build docs
run: cd website && npm run build
working-directory: website
run: npm run build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -65,6 +70,7 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: ${{github.repository == 'cheeriojs/cheerio'}}
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit a6dc56d

Please sign in to comment.