../public/snippets/githubactions.yml
GitHub Actions is a CI/CD platform for automating workflows and managing deployments directly within GitHub repositories.
With over three years of experience using GitHub Actions, I have automated build, test, and deployment processes efficiently.
I have used GitHub Actions to streamline CI/CD pipelines, integrating with various cloud services and ensuring consistent application deployment.
name: 'Deploy production'
on:
push:
branches:
- main
jobs:
deploy_lambda:
runs-on: ubuntu-latest
steps:
- name: 'Checking out code'
uses: actions/checkout@v2
- name: 'Setting up Nodejs environment'
uses: actions/setup-node@v2
with:
node-version: '18'
- name: 'Configuring AWS Credentials'
uses: aws-actions/configure-aws-credentials@v1
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: 'Installing dependencies'
env:
CI: true
run: npm ci
- name: 'Checking TS'
run: npm run check
- name: 'Linting code'
run: npm run lint
- name: 'Running tests'
env:
NAMESPACE: ${{ secrets.NAMESPACE }}
AES_KEY: ${{ secrets.AES_KEY }}
run: npm test
- name: 'Bundling files'
run: npx ncc build src/index.ts
- name: 'Zipping bundled file'
run: zip -j deploy.zip ./dist/*