Skip to content

Commit fa2c334

Browse files
Update the action to publish a zip file of the material content
1 parent 2408a73 commit fa2c334

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/trigger-website-publishing.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,30 @@ jobs:
2424
-H "X-GitHub-Api-Version: 2022-11-28" \
2525
https://api.github.com/repos/$repo_owner/$repo_name/actions/workflows/$workflow_file/dispatches \
2626
-d "$json_data"
27+
28+
publish_zip:
29+
runs-on: ubuntu-latest
30+
needs: [] # Run in parallel
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
- name: Zip course-material
36+
run: |
37+
cd course-material
38+
zip -r ../course-material.zip .
39+
cd ..
40+
41+
- name: Upload to GitHub Pages branch
42+
run: |
43+
mkdir gh-pages
44+
mv course-material.zip gh-pages/
45+
cd gh-pages
46+
git init
47+
git config user.name "github-actions"
48+
git config user.email "github-actions@github.com"
49+
git add .
50+
git commit -m "Publish course-material.zip"
51+
git branch -M gh-pages
52+
git remote add origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
53+
git push -f origin gh-pages

0 commit comments

Comments
 (0)