genareate pdf functionlity using aws s3 and pdf lif , V1 #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CICD for EBS in node js | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Installing NPM | |
run: npm install | |
- name: Building application | |
run: npm run build | |
- name: Generate deployment package | |
run: zip -r deploy.zip * -x "**node_modules**" | |
- name: Get timestamp | |
uses: gerred/actions/current-time@master | |
id: current-time | |
- name: Run string replace | |
uses: frabert/replace-string-action@master | |
id: format-time | |
with: | |
pattern: '[:\.]+' | |
string: "${{ steps.current-time.outputs.time }}" | |
replace-with: "-" | |
flags: "g" | |
- name: Beanstalk Deploy for app | |
uses: einaregilsson/beanstalk-deploy@v20 | |
with: | |
aws_access_key: ${{secrets.ACCESS_KEY_ID}} | |
aws_secret_key: ${{secrets.SECRET_ACCESS_KEY}} | |
application_name: loamic-server | |
environment_name: Environment name | |
region: Region | |
version_label: "my-app-${{ steps.format-time.outputs.replaced }}" | |
deployment_package: deploy.zip | |
- name: Deployed! | |
run: echo App deployed to EBS |