-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0c4302
commit 32ffac7
Showing
21 changed files
with
7,910 additions
and
14,693 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,8 @@ | ||
cypress/ | ||
node_modules/ | ||
vendor/ | ||
tmp/ | ||
log/ | ||
.git/ | ||
spec/ | ||
docker-compose.yml |
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
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,62 @@ | ||
name: Deploy to AWS | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
name: Build, Push to ECR, and Deploy to Fargate | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::723548248552:role/githubAction | ||
aws-region: us-east-1 | ||
|
||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
with: | ||
mask-password: 'true' | ||
|
||
- name: Build, tag, and push image to Amazon ECR | ||
id: build-image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: imperial-app | ||
IMAGE_TAG: ${{ github.sha }} | ||
run: | | ||
docker build -t $ECR_REPOSITORY:$IMAGE_TAG -f Dockerfile . | ||
docker tag $ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG | ||
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT | ||
- name: Download task definition | ||
run: | | ||
aws ecs describe-task-definition --task-definition imperial-app --query taskDefinition > task-definition.json | ||
- name: Fill in the new image ID in the Amazon ECS task definition | ||
id: task-def | ||
uses: aws-actions/amazon-ecs-render-task-definition@v1 | ||
with: | ||
task-definition: task-definition.json | ||
container-name: imperial | ||
image: ${{ steps.build-image.outputs.image }} | ||
|
||
- name: Deploy Amazon ECS task definition | ||
uses: aws-actions/amazon-ecs-deploy-task-definition@v2 | ||
with: | ||
task-definition: ${{ steps.task-def.outputs.task-definition }} | ||
service: ${{ secrets.SERVICE_NAME }} | ||
cluster: ${{ secrets.CLUSTER_NAME }} | ||
wait-for-service-stability: true |
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
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
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,17 @@ | ||
FROM ruby:3.2.2-slim | ||
WORKDIR /app | ||
RUN apt-get update -qq && apt-get install -y \ | ||
libpq-dev \ | ||
nodejs \ | ||
npm \ | ||
yarn \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install --without development test | ||
COPY package.json yarn.lock ./ | ||
RUN npm install -g yarn@1.22.21 | ||
RUN yarn install | ||
COPY . . | ||
RUN bundle exec ./bin/webpack | ||
EXPOSE 80 | ||
CMD ["rails", "s", "-b", "0.0.0.0", "-p", "80"] |
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,17 @@ | ||
FROM ruby:3.2.2-slim | ||
WORKDIR /app | ||
RUN apt-get update -qq && apt-get install -y \ | ||
libpq-dev \ | ||
nodejs \ | ||
npm \ | ||
yarn \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install | ||
COPY package.json yarn.lock ./ | ||
RUN npm install -g yarn@1.22.21 | ||
RUN yarn install | ||
COPY . . | ||
RUN bundle exec ./bin/webpack | ||
EXPOSE 3000 | ||
CMD ["rails", "s", "-b", "0.0.0.0"] |
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
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
sTk6GUI0CbEHxSKZ72/CoPW+mFPOPW1FZdsQ7hCIyS8ysD77TjNs4Xrzdx7SIe/RhVKzC4ms4EFNoEDWtOOWVsRkY0Udvc0q9O5Pabz3zayhbG7Mt/mcTcWENV1D9WkatkXLYuVqcBfHB9jyYGY2OGHOz0pKWOq8220PAvpElMtemLqryv1AZ7wUeH/SMjNZguOviETFPwuzv1BKzyZN4gJdEMRbQx1E60k92NSVTXwZdoLLuT1a4MV0QUVTtRJxy6jpoofiNQfStBBm/e+iq+VckWVZWZAhs3l+05fAT30xS9o67eP9CcOq2V6/TezlRfhDf7hhqK4MPqNfsC3fVt+oykxtjW5kAo0dBOyHVmt5F91i7vsZB/qRwRYq/YD/OQVC2AOJeAH0PubaWadl63Kj6uyHpb4QGnNG--P3hvyPLqGejrpUSA--t21niZCtyOmwUHiaZ7eT5w== | ||
vwb77QWn4hYEykY6jcCYC47PLoutybau0WXalgxvqQLwxlXnk1u4f/X64XapK9mzUWKLH42s3fE/vkIIevTUVrSzl1ye6uM69LPyzyO/W4Yh6OumyAgnALNrwVj7VWwPMlWX5hH6x9wBUTOA4gLxVJCZTFTc8TkJ7nu4N2JviDtMwNREB59wbIV715eEoJfh2UIj7uikP4mhM03PML+tjt9D0oKcfVxKv7xmCinvww6QJ4espYzNxLnjUCGq0Rk6SZoSi/DqLHTCmxbdMyQiKnE0RDzOp41++jRfLk8U2P/04ihk0Y1T78mfp90FITx5KMNs+w0Au3vljceHMzQqByv/Lv0uuFgYtizSX3wbaaOZyhUV4T5E6v/G5LU6jfyh9u1bA11vhSfLNNFJBCwfEhxeEz3K3s0=--Oz0Z/7tQ/Dd+hE5m--AYVW+Ack+X5f/y7URMvlYw== |
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
require "redis" | ||
|
||
REDIS = Redis.new(ssl_params: {verify_mode: OpenSSL::SSL::VERIFY_NONE}) | ||
REDIS = Redis.new(url: ENV["REDIS_URL"] || "redis://redis:6379/0") | ||
REDIS.set("online_users", [].to_json) | ||
REDIS.set("users_observing_games", {}.to_json) |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Sidekiq.configure_server do |config| | ||
config.redis = {ssl_params: {verify_mode: OpenSSL::SSL::VERIFY_NONE}} | ||
config.redis = {url: ENV["REDIS_URL"], namespace: "imperial_production"} | ||
end | ||
|
||
Sidekiq.configure_client do |config| | ||
config.redis = {ssl_params: {verify_mode: OpenSSL::SSL::VERIFY_NONE}} | ||
config.redis = {url: ENV["REDIS_URL"], namespace: "imperial_production"} | ||
end |
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
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
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,35 @@ | ||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile.dev | ||
platform: linux/amd64 | ||
depends_on: | ||
- db | ||
- redis | ||
ports: | ||
- "3000:3000" | ||
volumes: | ||
- .:/app | ||
- /app/vendor | ||
- /app/node_modules | ||
environment: | ||
DATABASE_URL: postgres://postgres:password@db:5432/postgres | ||
RAILS_ENV: development | ||
command: ["sh", "-c", "rm -f tmp/pids/server.pid && bin/rails db:migrate && rails s -b 0.0.0.0"] | ||
db: | ||
image: postgres:13 | ||
container_name: db | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
POSTGRES_DB: postgres | ||
volumes: | ||
- db-data:/var/lib/postgresql/data | ||
ports: | ||
- "5432:5432" | ||
redis: | ||
image: redis:alpine | ||
volumes: | ||
db-data: | ||
driver: local |
Oops, something went wrong.