A simple Gatsby wiki with GitHub Actions, Azure App Service container and Google authentication (log in with Gmail)
- CD to the root of the project
- Install all required NPM packages
$ yarn
- Start Gatsby in development mode
$ yarn start
- Use the following commands to test a Docker container
$ docker build --tag wiki-image --no-cache . $ docker run --rm --env-file .env --publish 8000:8000 --name wiki wiki-image $ docker stop wiki $ docker exec -it wiki /bin/sh
- Create a private DockerHub repository.
- Get DockerHub token from Account Settings > Security > New Access Token.
- Create a new Azure App Service with a container.
- Use Docker Hub registry and select
mcr.microsoft.com/dotnet/samples:aspnetapp
image - Check deployment logging.
- Open a browser and navigate to https://[YOUR_APP_SERVICE_NAME].azurewebsites.net/
- You should find an example of ASP.NET Core MVC app.
- Example of Azure CLI to create a new Azure App Service Container:
az webapp create \ --name [YOUR_APP_SERVICE_NAME] \ --resource-group [YOUR_RESOURCE_GROUP_NAME] \ --plan [YOUR_APP_SERVICE_PLAN] \ --deployment-container-image-name mcr.microsoft.com/dotnet/samples:aspnetapp
- Set these configurations to your app service:
WEBSITE_WEBDEPLOY_USE_SCM
- true
WEBSITES_PORT
- 8000
OAUTH2_CLIENT_ID
- Set value to your Google Oauth2 client ID.
OAUTH2_CLIENT_SECRET
- Set value to your Google Oauth2 client secret.
OAUTH2_REDIRECT_URL
- Set value to your public website redirect URL. It is usually in: https://[YOUR_APP_SERVICE_NAME].azurewebsites.net/oauth2/callback
DOCKER_REGISTRY_SERVER_URL
- index.docker.io
DOCKER_REGISTRY_SERVER_USERNAME
- Your
DOCKER_REGISTRY_SERVER_PASSWORD
- Your ACR password
- Create these GitHub secrets with their values:
AZURE_WEBAPP_CONTAINER_PUBLISH_PROFILE
- Download publish profile from your App Service and use it as a value of AZURE_WEBAPP_CONTAINER_PUBLISH_PROFILE secret.
AZURE_WEBAPP_NAME
- Your app service name, only name, no
https://
or.azurewebsites.net
.
- Your app service name, only name, no
DOCKER_HUB_REPOSITORY
- Your Docker Hub project repository name
DOCKER_HUB_USERNAME
- Your Docker Hub username
DOCKER_HUB_TOKEN
- Your Docker Hub access token
AUTHENTICATED_EMAILS
- authenticated emails in base64 format which containers each line per an email.
- It can be created as
$ cat filename | base64
- Go to GitHub Action tab and enable it
- Create new commit and push the project to the main branch
- Go to https://console.cloud.google.com/cloud-resource-manager.
- Add test users' emails to be the same as a value AUTHENTICATED_EMAILS secret.
- Protected website with Gmail authentication
- Markdown & MDX (React component)
- Theme shadowing
- You need to create a link to a page manually, not automatically discover.
- Not realtime deployment and wait 3-4 minutes for each deployment.
- To start login over again, clear cookie and ctrl+f5
- Configuration not load and no value in docker run
- Restart a website and make http request.
- Error: Deployment Failed with Error: Error: Failed to get app runtime OS
- It can be from an invalid publish profile.
- Improve code quality
- Use async/await