From 889b24fdea3e9d51e651a0f5667211e1dc00ef73 Mon Sep 17 00:00:00 2001 From: yash Date: Fri, 3 Oct 2025 08:20:41 +0100 Subject: [PATCH 1/2] Pushing image to AWS ECR --- .github/workflows/build.yml | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 231931e..4ca87d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,15 +1,14 @@ -name: Build and Publish overpass-api +name: Build and Publish overpass-api to ECR on: push: - branches: [ master ] + branches: [ aws-deploy-test ] jobs: build: runs-on: ubuntu-latest permissions: contents: read - packages: write steps: - name: Checkout repository @@ -28,12 +27,18 @@ jobs: cp -r etc bin 0.7.62.7/ cp docker-entrypoint.sh requirements.txt docker-healthcheck.sh 0.7.62.7/ - - name: Log in to GHCR - uses: docker/login-action@v3 + # ✅ Authenticate with AWS + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: ${{ secrets.AWS_REGION }} + + # ✅ Log in to Amazon ECR + - name: Log in to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 - name: Build and push Overpass 0.7.62.7 uses: docker/build-push-action@v6 @@ -42,5 +47,5 @@ jobs: file: ./0.7.62.7/Dockerfile push: true tags: | - ghcr.io/dubsof/overpass-api:0.7.62.7 - ghcr.io/dubsof/overpass-api:latest + ${{ steps.login-ecr.outputs.registry }}/overpass-api:0.7.62.7 + ${{ steps.login-ecr.outputs.registry }}/overpass-api:latest From 727abe0e30e85f941370975444898e14a2ee21b3 Mon Sep 17 00:00:00 2001 From: yash Date: Tue, 7 Oct 2025 10:04:12 +0100 Subject: [PATCH 2/2] feat: add workflows for both ECR and GHCR --- .../workflows/{build.yml => build-ecr.yml} | 0 .github/workflows/build-ghcr.yml | 46 +++++++++++++++++++ 2 files changed, 46 insertions(+) rename .github/workflows/{build.yml => build-ecr.yml} (100%) create mode 100644 .github/workflows/build-ghcr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build-ecr.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/build-ecr.yml diff --git a/.github/workflows/build-ghcr.yml b/.github/workflows/build-ghcr.yml new file mode 100644 index 0000000..9258535 --- /dev/null +++ b/.github/workflows/build-ghcr.yml @@ -0,0 +1,46 @@ +name: Build and Publish overpass-api to GHCR + +on: + push: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Generate Dockerfiles + run: python update.py + + - name: Prepare build context + run: | + cp -r etc bin 0.7.62.7/ + cp docker-entrypoint.sh requirements.txt docker-healthcheck.sh 0.7.62.7/ + + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Overpass 0.7.62.7 + uses: docker/build-push-action@v6 + with: + context: ./0.7.62.7 + file: ./0.7.62.7/Dockerfile + push: true + tags: | + ghcr.io/dubsof/overpass-api:0.7.62.7 + ghcr.io/dubsof/overpass-api:latest \ No newline at end of file