-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
2 changed files
with
69 additions
and
0 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,43 @@ | ||
name: Build and Deploy to AWS ECR | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-west-2 | ||
|
||
- name: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
with: | ||
mask-password: true | ||
|
||
- name: Build, Tag, and Push Docker image to ECR | ||
run: | | ||
docker build -t clearsettleengine . | ||
docker tag counter_web 211125762589.dkr.ecr.us-west-2.amazonaws.com/repo:clearsettleengine | ||
docker push 211125762589.dkr.ecr.us-west-2.amazonaws.com/repo:clearsettleengine | ||
env: | ||
AWS_DEFAULT_REGION: us-west-2 | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
- name: Trigger Deployment | ||
uses: peter-evans/repository-dispatch@v1 | ||
with: | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
repository: tim-br/counter_k8s | ||
event-type: deploy-clearsettleengine-event |
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,26 @@ | ||
# Use an official Elixir runtime as a parent image | ||
FROM elixir:latest | ||
|
||
# Create and set the working directory | ||
WORKDIR /app | ||
|
||
# Copy the mix.exs and mix.lock files to the container | ||
COPY mix.exs mix.lock ./ | ||
|
||
# Install hex and rebar | ||
|
||
RUN mix archive.install github hexpm/hex branch latest --force | ||
|
||
RUN mix local.rebar --force | ||
# Install dependencies | ||
RUN mix deps.get | ||
|
||
# Copy the rest of your application's code | ||
COPY . . | ||
|
||
# Compile the project | ||
|
||
RUN mix do compile | ||
|
||
# Run the application | ||
CMD ["mix", "run"] |