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

NEW Move deployment to GitHub Pages #142

Conversation

GuySartorelli
Copy link
Member

Description

Adds a new workflow to build and deploy to GitHub Actions, removes references to Vercel, and makes a small change necessary for the site to work in its new hosting.

Manual testing steps

You can try this out in your own account if you want - but here's one I prepared earlier and here's the deployment

Issues

Copy link

vercel bot commented Jun 25, 2024

@GuySartorelli is attempting to deploy a commit to the SilverStripe Team on Vercel.

A member of the Team first needs to authorize it.

@GuySartorelli GuySartorelli mentioned this pull request Jun 25, 2024
5 tasks
Comment on lines +8 to +12
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "gh-pages"
cancel-in-progress: false
Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't strictly necessary, but it was shown in the documentation and seems like a good safeguard to ensure we don't get into a broken state if one action is interrupted and then the subsequent one fails, or something like that.

runs-on: ubuntu-latest
if: github.repository_owner == 'silverstripe'
permissions:
contents: read
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed for code checkout

Comment on lines +62 to +64
permissions:
pages: write
id-token: write
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

This file was only for vercel

You can use it on https://github-issue-search-client-silverstripe.vercel.app.
You can use it on <https://silverstripe.github.io/github-issue-search-client/>.
Copy link
Member Author

@GuySartorelli GuySartorelli Jun 25, 2024

Choose a reason for hiding this comment

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

This URL will change again once we have a solid subdomain - but it's better than having the vercel URL here in the meantime.

Copy link
Member Author

Choose a reason for hiding this comment

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

Just removing the "powered by Vercel" link

@@ -8,5 +8,6 @@ module.exports = {
apollo: {
lintGQL: false
}
}
},
publicPath: "./"
Copy link
Member Author

Choose a reason for hiding this comment

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

Required for the script and style tags to use relative paths, which is necessary for them to load at all in GitHub Pages (at least until we have a solid subdomain - but even then relative will work)

run: |
cat << EOF > .env
VUE_APP_GRAPHQL_ENDPOINT=https://api.github.com/graphql
VUE_APP_GRAPHQL_TOKEN=${{ secrets.GRAPHQL_TOKEN_FOR_GH_PAGES }}
Copy link
Member Author

Choose a reason for hiding this comment

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

I've moved the same token that Vercel was using into the secrets for this repository.
Note that this token has always been made public by being included in the dist *.js files, so there's no change in attack surface by including it here like this. The .env file isn't included in the artifacts and therefore isn't in the GitHub Pages result - but the token will will be in the dist *.js files as it always has been.

@emteknetnz emteknetnz merged commit a0d3c1a into silverstripe:master Jun 26, 2024
1 check failed
@emteknetnz emteknetnz deleted the pulls/master/migrate-to-github-pages branch June 26, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants