diff --git a/.github/workflows/build-ecr.yml b/.github/workflows/build-ecr.yml new file mode 100644 index 0000000..4ca87d1 --- /dev/null +++ b/.github/workflows/build-ecr.yml @@ -0,0 +1,51 @@ +name: Build and Publish overpass-api to ECR + +on: + push: + branches: [ aws-deploy-test ] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + + 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/ + + # ✅ Authenticate with AWS + - 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: ${{ 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 + with: + context: ./0.7.62.7 + file: ./0.7.62.7/Dockerfile + push: true + tags: | + ${{ steps.login-ecr.outputs.registry }}/overpass-api:0.7.62.7 + ${{ steps.login-ecr.outputs.registry }}/overpass-api:latest diff --git a/.github/workflows/build.yml b/.github/workflows/build-ghcr.yml similarity index 91% rename from .github/workflows/build.yml rename to .github/workflows/build-ghcr.yml index 231931e..9258535 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build-ghcr.yml @@ -1,4 +1,4 @@ -name: Build and Publish overpass-api +name: Build and Publish overpass-api to GHCR on: push: @@ -43,4 +43,4 @@ jobs: push: true tags: | ghcr.io/dubsof/overpass-api:0.7.62.7 - ghcr.io/dubsof/overpass-api:latest + ghcr.io/dubsof/overpass-api:latest \ No newline at end of file