From 1cb37e3b1519e839fd2c75a2f6629b438259f8e9 Mon Sep 17 00:00:00 2001 From: zignis Date: Thu, 20 Mar 2025 18:26:43 +0530 Subject: [PATCH] add workflows --- .github/workflows/deploy.yaml | 0 .github/workflows/test.yaml | 49 +++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..e69de29 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..4e59364 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,49 @@ +name: deploy + +on: + push: + branches: + - main + +jobs: + deploy: + name: Deploy Discovery + runs-on: self-hosted + environment: production + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - 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 }} + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + # Uncomment for non-arm based runners + # + # - name: Set up QEMU + # uses: docker/setup-qemu-action@v3 + # with: + # platforms: arm64 + # + # - name: Set up Docker Buildx + # uses: docker/setup-buildx-action@v3 + + - name: Build, tag, and push discovery image + id: build-discovery-image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + run: | + docker build \ + --platform linux/arm64 \ + -f Dockerfile \ + -t $ECR_REGISTRY/storiny_discovery:latest . + docker push $ECR_REGISTRY/storiny_discovery:latest + echo "discovery-image=$ECR_REGISTRY/storiny_discovery:latest" >> $GITHUB_OUTPUT