Skip to content

Commit

Permalink
Use GitHub Actions for CI, deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
pjsier committed Oct 12, 2019
1 parent ff3eefb commit e82b30d
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI Checks
on: [push, pull_request]
jobs:

check:
name: Check
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

- name: Test
run: make test

- name: Build
run: make build
43 changes: 43 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Deploy
on:
push:
branches:
- master

env:
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
TWITTER_ACCESS_SECRET: ${{ secrets.TWITTER_ACCESS_SECRET }}
RDS_DB_NAME: ${{ secrets.RDS_DB_NAME }}
RDS_USERNAME: ${{ secrets.RDS_USERNAME }}
RDS_PASSWORD: ${{ secrets.RDS_PASSWORD }}
SNS_EMAIL: ${{ secrets.SNS_EMAIL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:

deploy:
name: Deploy
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v1

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

- name: npm install
uses: actions/npm@master
with:
args: install

- name: Build
run: make build

- name: Deploy
run: make deploy
9 changes: 9 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ provider:
name: aws
runtime: go1.x
stage: prod
environment:
TWITTER_CONSUMER_KEY: ${env:TWITTER_CONSUMER_KEY}
TWITTER_CONSUMER_SECRET: ${env:TWITTER_CONSUMER_SECRET}
TWITTER_ACCESS_TOKEN: ${env:TWITTER_ACCESS_TOKEN}
TWITTER_ACCESS_SECRET: ${env:TWITTER_ACCESS_SECRET}
RDS_DB_NAME: ${env:RDS_DB_NAME}
RDS_USERNAME: ${env:RDS_USERNAME}
RDS_PASSWORD: ${env:RDS_PASSWORD}
SNS_EMAIL: ${env:SNS_EMAIL}
iamRoleStatements:
- Effect: Allow
Action:
Expand Down

0 comments on commit e82b30d

Please sign in to comment.