Skip to content

Commit

Permalink
Merge branch 'main' into SITES-26123
Browse files Browse the repository at this point in the history
  • Loading branch information
solaris007 authored Dec 20, 2024
2 parents 166fff0 + 3f9b413 commit 978f346
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 92 deletions.
89 changes: 0 additions & 89 deletions .circleci/config.yml

This file was deleted.

134 changes: 134 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: CI

permissions:
id-token: write
contents: write
issues: read

on: [push]

env:
CI_BUILD_NUM: ${{ github.run_id }}
CI_BRANCH: ${{ github.ref_name }}
HLX_AWS_REGION: ${{ secrets.AWS_REGION }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint

- name: Getting Code Coverage
run: npm run test

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Semantic Release (Dry Run)
if: github.ref != 'refs/heads/main'
run: npm run semantic-release-dry
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}

semantic-release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12

- name: Install dependencies
run: npm ci

- name: Revert changes to package-lock.json
run: git checkout -- package-lock.json

- name: Configure Environment
run: echo -e "LOG_LEVEL=info\n" > .env

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::282898975672:role/spacecat-role-github-actions

- name: Fetch AWS Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: |
/spacecat/github-action-secrets
- name: Semantic Release
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.ADOBE_BOT_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}

branch-deploy:
runs-on: ubuntu-latest
needs: build
if: github.ref != 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22.12

- name: Install dependencies
run: npm ci

- name: Revert changes to package-lock.json
run: git checkout -- package-lock.json

- name: Configure AWS Credentials
id: creds
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::282898975672:role/spacecat-role-github-actions

- name: Fetch AWS Secrets
uses: aws-actions/aws-secretsmanager-get-secrets@v2
with:
parse-json-secrets: true
secret-ids: |
/spacecat/github-action-secrets
- name: Branch Deployment
run: npm run deploy-ci
env:
AWS_REGION: us-east-1

- name: Post-Deployment Integration Test
run: npm run test-postdeploy

- name: Upload post-deployment coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
"lint": "eslint .",
"logs": "aws logs tail /aws/lambda/spacecat-services--audit-worker",
"semantic-release": "semantic-release",
"semantic-release-dry": "semantic-release --dry-run --no-ci --branches $CIRCLE_BRANCH",
"semantic-release-dry": "semantic-release --dry-run --no-ci --branches $CI_BRANCH",
"build": "hedy -v --test-bundle",
"deploy": "hedy -v --deploy --test",
"deploy-routes": "hedy --no-build -no-hints -l major",
"deploy-ci": "hedy -v --deploy --test --pkgVersion=ci$CIRCLE_BUILD_NUM -l ci --cleanup-ci=24h",
"deploy-ci": "hedy -v --deploy --test --pkgVersion=ci$CI_BUILD_NUM -l ci --cleanup-ci=24h",
"deploy-secrets": "hedy --aws-update-secrets --params-file=secrets/secrets.env",
"prepare": "husky"
},
Expand All @@ -31,7 +31,7 @@
},
"fastlyServiceId!important": "",
"timeout": 900000,
"nodeVersion": 20
"nodeVersion": 22
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 978f346

Please sign in to comment.