Skip to content

Commit 2c3aa19

Browse files
committed
Page pushing
1 parent 6591865 commit 2c3aa19

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/sync.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,28 @@ jobs:
2222
# Run python generate.py
2323
- name: Run python generate.py
2424
run: |
25-
python3 generate.py
25+
python3 generate.py --no-dry-run
26+
- name: Upload Pages artifact
27+
uses: actions/upload-pages-artifact@v2
28+
with:
29+
path: pages
30+
deploy-pages:
31+
# Add a dependency to the build job
32+
needs: sync
33+
34+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
35+
permissions:
36+
pages: write # to deploy to Pages
37+
id-token: write # to verify the deployment originates from an appropriate source
38+
39+
# Deploy to the github-pages environment
40+
environment:
41+
name: github-pages
42+
url: ${{ steps.deployment.outputs.page_url }}
43+
44+
# Specify runner + deployment step
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Deploy to GitHub Pages
48+
id: deployment
49+
uses: actions/deploy-pages@v2 # or the latest "vX.X.X" version tag for this action

generate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ def generate_html(base_cars_base_branches):
139139
</body>
140140
</html>
141141
"""
142-
with open("index.html", "w") as f:
142+
# Make pages directory if it doesn't exist
143+
os.system("mkdir -p pages")
144+
with open("pages/index.html", "w") as f:
143145
f.write(header + body + footer)
144146

145147
def main(push=True):

0 commit comments

Comments
 (0)