Skip to content

Instantly share code, notes, and snippets.

@webhacking
Created May 2, 2020 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webhacking/854f6913eebd9b7f31538a276d68af91 to your computer and use it in GitHub Desktop.
Save webhacking/854f6913eebd9b7f31538a276d68af91 to your computer and use it in GitHub Desktop.
serverless deploy github actions
on:
push:
branches:
- master
name: Deploy master branch
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Showing dir
run: ls -al
- name: Npm install
run: npm install
- name: Build
run: npm run build
- name: serverless deploy
uses: serverless/github-action@master
with:
args: deploy
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow # selectable (default: repo,message)
if: always() # Pick up events even if the job fails or is canceled.
env:
SERVERLESS_ACCESS_KEY: ${{ secrets.AWS_EMOTION_IAM_ACCESS_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # optional
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required
# or if using AWS creds directly
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment