Skip to content

Commit

Permalink
Revert "Running the project on my raspberry pi"
Browse files Browse the repository at this point in the history
This reverts commit 65d5d0e.
  • Loading branch information
AtulGoel committed Oct 30, 2024
1 parent 65d5d0e commit 5a614a0
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,67 +20,56 @@ env:

jobs:
build:
runs-on: [self-hosted, nodejs-build] # Added label for this project
runs-on: ubuntu-latest
environment: dev
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install dependencies
run: npm install

- name: Build project
run: npm run build

- name: Run tests
run: npm test

- name: CDK Synth
run: npm run cdk-synth
env:
CDK_DEFAULT_ACCOUNT: ${{ vars.AWS_ACCOUNT_ID }}
CDK_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}

checkov:
runs-on: [self-hosted, nodejs-build] # Added label for this project
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'

- name: Install Checkov
run: pip install checkov

- name: Run Checkov
run: checkov -d .

docker:
runs-on: [self-hosted, nodejs-build] # Added label for this project
runs-on: ubuntu-latest
needs: checkov
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
uses: docker/build-push-action@v5
with:
Expand All @@ -93,20 +82,17 @@ jobs:
ghcr.io/${{ github.repository }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'

- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'

- name: Push Docker image
if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/main-week2-day5-6')
uses: docker/build-push-action@v5
Expand All @@ -117,4 +103,8 @@ jobs:
ghcr.io/${{ github.repository }}/${{ env.DOCKER_IMAGE_NAME }}:latest
ghcr.io/${{ github.repository }}/${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

0 comments on commit 5a614a0

Please sign in to comment.