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 GitHub pages deploy #666

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
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
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ jobs:
- name: Deploy
run: yarn deploy

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: 'dist'

- name: Deploy to github pages 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: build # The folder the action should deploy.
id: deployment
uses: actions/deploy-pages@v2
Comment on lines +39 to +47
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure to understand, the difference between the two

"Upload artifact" is uploading the dist folder. But then what is doing the actions/deploy-pages@v2?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deploy to Github pages via an action you first need to upload an artifact with a specific name and then invoke the deploy-pages action. See https://github.com/actions/deploy-pages/tree/main#usage

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explaination

4 changes: 2 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

cd build;
cd dist;
cp index.html 404.html;
cp index.html insights.html;
cp index.html questions.html;
cp index.html eco-score.html;
cp index.html settings.html;
cp index.html logos.html;
cd ..;
cd ..;