Skip to content

Instantly share code, notes, and snippets.

@Markkos89
Last active November 15, 2020 16:34
Show Gist options
  • Save Markkos89/8492a24e3f8b8f1a7566c3bf1260ebba to your computer and use it in GitHub Desktop.
Save Markkos89/8492a24e3f8b8f1a7566c3bf1260ebba to your computer and use it in GitHub Desktop.
name: Deploy Beanstalk
on:
push:
branches:
- master
- hotfix/ci*
- ci/*
paths:
- "packages/api/*"
paths-ignore: # Don't trigger on files that are updated by the CI
- "*.md"
defaults:
run:
working-directory: ./packages/api
jobs:
build:
name: Build Nest App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name:
uses: actions/setup-node@v2-beta
with:
node-version: 'lts'
- name: Create dist
run: |
# Install nest global
npm install -g @nestjs/cli
# Instal prod dependencies
npm install
# Pre build
npm run prebuild
# Build
npm run build
- name: Create zip dist
uses: montudor/[email protected]
with:
args: zip -qq -r ./deploy.zip ./dist package.json package-lock.json ormconfig.js ./.elasticbeanstalk ./.ebextensions
- name: Artifact zip dist
uses: actions/upload-artifact@v2
with:
name: deploy
path: deploy.zip
deploy:
name: Deploy Beanstalk
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v2
with:
name: deploy
- name: Create zip dist
uses: montudor/[email protected]
with:
args: unzip -qq deploy.zip
- name: Delete zip file
run: |
rm deploy.zip
- name: Deploy
uses: hmanzur/[email protected]
with:
command: 'deploy dashinejos'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: "us-east-1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment