Connect Amplication server to GitHub
Amplication already provides built-in integration with GitHub to push the generated application to a GitHub repository.
When running a local Amplication server you first need to configure the server to integrate with a new GitHub app, following the steps below.
info
When using the hosted service on https://app.amplication.com, the integration is pre-configured and you just need to follow this guide to sync your application with GitHub.
Create a new GitHub App
- Go to https://github.com/settings/developers.
- Click on OAuth Apps.
- Click on Register a new application.
- Give the application any name.
- Set the Authorization callback URL URL to http://localhost:3001
info
In case you are hosting the Amplication server on any other address, use the specific address instead of http://localhost:3001
- Copy and save the client secret and client ID of your new GitHub application.
Configure Amplication server to work with the new GitHub app
Go the ../packages/amplication-server/
Add a .env.local file in the root of the server directory
../packages/amplication-server/.env.local
- Add the following content to the file
GITHUB_SECRET_SECRET_NAME=use_local_settings
GITHUB_CLIENT_SECRET=[client_secret_here]
GITHUB_CLIENT_ID=[client_id_here]
GITHUB_APP_AUTH_SCOPE=user:email,repo,read:org
GITHUB_APP_AUTH_REDIRECT_URI=http://localhost:3001/github-auth-app/callback/{appId}
Replace [client_secret_here] with the client secret of the new GitHub application.
Replace [client_id_here] with the client ID of the new GitHub application.
Restart Amplication server.