-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1718 from quadratichq/self-hosting-setup
MVP of self-hosting
- Loading branch information
Showing
135 changed files
with
4,442 additions
and
1,342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Build and Publish Images to ECR | ||
|
||
on: | ||
push: | ||
branches: | ||
- self-hosting-setup #remove | ||
- main | ||
|
||
concurrency: | ||
group: production-publish-images | ||
|
||
jobs: | ||
publish_images: | ||
runs-on: ubuntu-latest-8-cores | ||
strategy: | ||
matrix: | ||
service: [multiplayer, files, connection, client, api] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Login to Amazon ECR Public | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
registry-type: public | ||
|
||
- name: Define repository name | ||
id: repo-name | ||
run: | | ||
echo "REPO_NAME=quadratic-${{ matrix.service }}" >> $GITHUB_OUTPUT | ||
- name: Create Public ECR Repository if not exists | ||
id: create-ecr | ||
env: | ||
REPO_NAME: ${{ steps.repo-name.outputs.REPO_NAME }} | ||
run: | | ||
aws ecr-public create-repository --repository-name $REPO_NAME || true | ||
REPO_INFO=$(aws ecr-public describe-repositories --repository-names $REPO_NAME) | ||
ECR_URL=$(echo $REPO_INFO | jq -r '.repositories[0].repositoryUri') | ||
echo "ECR_URL=$ECR_URL" >> $GITHUB_OUTPUT | ||
- name: Read VERSION file | ||
id: version | ||
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT | ||
|
||
- name: Build, Tag, and Push Image to Amazon ECR Public | ||
env: | ||
ECR_URL: ${{ steps.create-ecr.outputs.ECR_URL }} | ||
IMAGE_TAG: ${{ steps.version.outputs.VERSION }} | ||
run: | | ||
docker build -t $ECR_URL:$IMAGE_TAG -t $ECR_URL:latest -f quadratic-${{ matrix.service }}/Dockerfile . | ||
docker push $ECR_URL:$IMAGE_TAG | ||
docker push $ECR_URL:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.