Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker CI for E2E #23

Merged
merged 3 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Backend CI

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be renamed


on:
push:
branches:
- "main"

workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false

env:
CARGO_TERM_COLOR: always
RUST_LOG: info
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}

jobs:
build_and_push_docker_images:
name: Build and push docker images
runs-on: ubuntu-latest-8-cores
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build and push api image
run: ./build-and-push-docker-images.sh api
- name: Build and push indexer image
run: ./build-and-push-docker-images.sh github-indexer

7 changes: 7 additions & 0 deletions build-and-push-docker-images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set +x;

aws ecr get-login-password --region eu-west-3 | docker login --username AWS --password-stdin 113659546096.dkr.ecr.eu-west-3.amazonaws.com
docker build -t marketplace-backend-$1 . --build-arg BIN_NAME=$1
docker tag marketplace-backend-$1:latest 113659546096.dkr.ecr.eu-west-3.amazonaws.com/marketplace-backend-$1:latest
docker push 113659546096.dkr.ecr.eu-west-3.amazonaws.com/marketplace-backend-$1:latest