-
Notifications
You must be signed in to change notification settings - Fork 17
Deploying the application
This project is still in progress so things can change until we have a stable version.
You can deploy the frontend by simply merging code into the main branch. GH Actions will take care of the rest for you. But if you really want to deploy manually, you can
-
cd client
to navigate to the client folder -
Set environment variables
export PUBLIC_URL='https://statistics.worldcubeassociation.org/' export REACT_APP_BASE_URL='https://statistics-api.worldcubeassociation.org'
-
Install and package with
yarn install && yarn build
-
Deploy with
aws s3 cp build s3://{{BUCKET-NAME}} --recursive
-
Create an invalidation for cloudfront replication
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths '/*'
Backend runs as an ECS task.
-
Build a new server image
cd server ./gradlew build -x test docker build -t thewca/statistics-server .
-
Push a new image to Docker Hub
-
Create a deploy
aws deploy create-deployment \ --application-name ${{ secrets.APPLICATION_NAME }} \ --deployment-group-name ${{ secrets.DEPLOYMENT_GROUP }} \ --s3-location ${{ secrets.S3_LOCATION }}
Cron image is really simple and it probably won't change much. The image is built on top of the cron script. It clones this repository and executes some scripts. Changes to the other scripts will be reflected to the cron, even using the same image, because it clones the repository and executes scripts from the main branch.
-
Build a new cron image (from the root)
docker build -t thewca/statistics-cron .
-
Push the new image to Docker Hub