Skip to content

update ci-cd

update ci-cd #5

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: [ "main" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Configure AWS ECR User 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: eu-central-1
- name: Install Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Run CMD npm ci
run: |
npm ci --legacy-peer-deps
- name: Build Application
run: |
npm run build
env:
CI: false
- name: Add version
run: |
pwd
ls -la
BUILD_VERSION="${GITHUB_REF_NAME}-${GITHUB_SHA:0:7}"
echo "BUILD_VERSION=${BUILD_VERSION}" >> $GITHUB_ENV
mv dist "build-${BUILD_VERSION}"
- name: Debug cmds
run: |
ls -la
pwd
- name: Zip the build
run: zip -r build-${{ env.BUILD_VERSION }}.zip build-${{ env.BUILD_VERSION }}/
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
path: build-${{ env.BUILD_VERSION }}.zip