From 0885ff12abb210c77a744a59ef111f9911e6247a Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Tue, 4 Nov 2025 17:38:23 +0200 Subject: [PATCH 1/6] artifacts upload action --- .github/workflows/ci.yaml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3537993..e0ba44a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -108,6 +108,41 @@ jobs: AWS_REGION: us-east-1 AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_STAGE}} + upload-build-artifacts: + runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/main' + steps: + - name: Check out + uses: actions/checkout@v5 + with: + persist-credentials: 'false' + + - name: Setup Node & NPM + uses: ./.github/actions/setup-node-npm + + - name: Configure AWS for DEV + uses: ./.github/actions/configure-aws + with: + aws_role_to_assume: 'arn:aws:iam::${{secrets.AWS_ACCOUNT_ID_DEV}}:role/spacecat-role-github-actions' + + - name: Create Build Artifacts + run: npm run build + env: + AWS_REGION: us-east-1 + AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} + + - name: Create ZIP File + run: zip -r spacecat-services--task-processor-latest.zip . + env: + AWS_REGION: us-east-1 + AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} + + - name: Upload ZIP File + run: aws s3 cp spacecat-services--task-processor-latest.zip s3://spacecat-artifacts-dev/spacecat-services--task-processor-latest.zip + env: + AWS_REGION: us-east-1 + AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} branch-deploy: runs-on: ubuntu-latest From 12f2538952d694849b6f2fedc593c373e6b0ccf8 Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Wed, 5 Nov 2025 12:20:35 +0200 Subject: [PATCH 2/6] upload only @versiune.zip --- .github/workflows/ci.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e0ba44a..2acd479 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,7 @@ jobs: upload-build-artifacts: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/artifacts-upload' steps: - name: Check out uses: actions/checkout@v5 @@ -132,13 +132,15 @@ jobs: AWS_REGION: us-east-1 AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} - - name: Create ZIP File - run: zip -r spacecat-services--task-processor-latest.zip . + - name: Create ZIP from Lambda Folder + run: | + cd dist/spacecat-services + zip -r ../../spacecat-services--task-processor-latest.zip task-processor@* env: AWS_REGION: us-east-1 AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} - - name: Upload ZIP File + - name: Upload Build Artifact run: aws s3 cp spacecat-services--task-processor-latest.zip s3://spacecat-artifacts-dev/spacecat-services--task-processor-latest.zip env: AWS_REGION: us-east-1 From 7711d7c1a97558a33ee1511fdcc0070841c95e4d Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Wed, 5 Nov 2025 12:45:47 +0200 Subject: [PATCH 3/6] upload only when merging with main --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2acd479..b1be57a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,7 @@ jobs: upload-build-artifacts: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/artifacts-upload' + if: github.ref == 'refs/heads/main' steps: - name: Check out uses: actions/checkout@v5 From 5a6db6ca2f2944657aa50200ea0485590e35c515 Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Wed, 5 Nov 2025 12:51:02 +0200 Subject: [PATCH 4/6] upload only @version.zip --- .github/workflows/ci.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b1be57a..a0f63d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,7 @@ jobs: upload-build-artifacts: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/upload-artifacts' steps: - name: Check out uses: actions/checkout@v5 @@ -132,10 +132,8 @@ jobs: AWS_REGION: us-east-1 AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} - - name: Create ZIP from Lambda Folder - run: | - cd dist/spacecat-services - zip -r ../../spacecat-services--task-processor-latest.zip task-processor@* + - name: Copy Build Artifact + run: cp dist/spacecat-services/task-processor@*.zip spacecat-services--task-processor-latest.zip env: AWS_REGION: us-east-1 AWS_ACCOUNT_ID: ${{secrets.AWS_ACCOUNT_ID_DEV}} From dc9e1d56aa37e2470d2c301ed0476dbdb66fdf65 Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Wed, 5 Nov 2025 12:57:24 +0200 Subject: [PATCH 5/6] change ref --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a0f63d3..e39c202 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,7 @@ jobs: upload-build-artifacts: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/upload-artifacts' + if: github.ref == 'refs/heads/artifacts-upload' steps: - name: Check out uses: actions/checkout@v5 From d62cf7a8ee8c25813c4bfd5cf0a347a71ea2416e Mon Sep 17 00:00:00 2001 From: Diana Preda Date: Wed, 5 Nov 2025 13:06:00 +0200 Subject: [PATCH 6/6] update ref --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e39c202..859a4f3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -111,7 +111,7 @@ jobs: upload-build-artifacts: runs-on: ubuntu-latest needs: build - if: github.ref == 'refs/heads/artifacts-upload' + if: github.ref == 'refs/heads/main' steps: - name: Check out uses: actions/checkout@v5