Simple site for UoP staff and Students to Request an invitation to the UoP Repos organisation
Website:
- Clone the repo
- Run
yarn install
ornpm install
- Run
yarn dev:site
ornpm run dev:site
to start development web server - Open http://localhost:3000/ in your browser
Cloud Functions:
-
Clone the repo
-
Run
yarn install
ornpm install
-
Run
"GITHUB_ORG=SOME_ORG \nGITHUB_TOKEN=GH_PAT" > .env.development.local
-
Update
.env.development.local
with your GitHub organisation and token (Use a token with theorg
scope). You may need to make a org for testing purposes. -
Run
yarn dev:cloud or npm run dev:cloud
to serve cloud functions locally (you will need to restart the server after every change) -
Run
~/git/github/uoprepos/RequestInvite(main) » curl --request POST \ --url <http://localhost:8080/> \ --header 'Content-Type: application/json' \ --data '{ "email":"[email protected]" # or Staff Email }'
The following instructions assume you are deploying to a Google Cloud Function with the default configuration of this Project (i.e. no customisation). If you are deploying to a different platform, please refer to the instructions for that platform.
If you would prefer to use Google cloud Secret Manager instead of the default configuration, please refer to the documentation for the Google Cloud Secret Manager.
Cloud Functions:
-
Download and setup Cloud SDK from google, You will need to Have a Google Cloud account.
-
Return into the root of the repo
~ » cd ~/git/github/uoprepos/
-
Add to .env.production.yaml
```yaml
GITHUB_ORG: "SOME_ORG"
GITHUB_TOKEN: "GH_PAT"
```
- Update
.env.production.yaml
with your GitHub organisation and token (Use a token with theorg
scope) - Run
yarn install
ornpm install
to update dependencies - Run
yarn deploy:cloud
ornpm run deploy:cloud
to deploy the cloud functions
Website:
-
I recommend you deploy the cloud functions first. As you need to know the URL of the cloud function.
-
Return into the root of the repo
~ » cd ~/git/github/uoprepos/
-
Run
yarn install
ornpm install
to update dependencies -
Update
.env.production
with theREGION
andPROJECT_ID
from the cloud function -
Run
yarn deploy:site
ornpm run deploy:site
to deploy the website to github pages -
Ensure github pages setup to use the
gh-pages
branch -
Open https://uoprepos.github.io/ in your browser