Skip to content

Commit

Permalink
Merge pull request #148 from silinternational/develop
Browse files Browse the repository at this point in the history
Release 3.1.1 - GitHub Actions
  • Loading branch information
briskt authored Feb 28, 2024
2 parents a5c186d + 2962dd2 commit b242d75
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 72 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test and Deploy

on:
push:

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

jobs:
test_and_deploy:
name: Test and Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Test
run: |
npm install --no-fund -g [email protected]
npm ci --no-fund
npm test
serverless --version
serverless info --conceal
- if: github.ref_name == 'develop'
run: serverless deploy --verbose --stage dev --region us-east-1
- if: github.ref_name == 'develop'
run: serverless deploy --verbose --stage dev --region us-west-2
- if: github.ref_name == 'main'
run: serverless deploy --verbose --stage prod --region us-east-1
- if: github.ref_name == 'main'
run: serverless deploy --verbose --stage prod --region us-west-2
19 changes: 2 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A Serverless API for registering and validating Multi-Factor Authentication meth
Currently supports Time-based One Time Passwords (TOTP) and FIDO U2F devices (YubiKeys).

For details about the various API endpoints, see
[the RAML file](https://github.com/silinternational/serverless-mfa-api/blob/master/api.raml).
[the RAML file](https://github.com/silinternational/serverless-mfa-api/blob/main/api.raml).

## Basic Workflow

Expand Down Expand Up @@ -73,21 +73,6 @@ For details about the various API endpoints, see
must be HTTPS. It does not need the full path though, so https://myapp.com is sufficient if the page is at
https://myapp.com/auth/login.

## Continuous Integration / Continuous Deployment (CI/CD)

To set this up on Codeship, do the following:

- Create a Codeship Basic project.
- Give it a Setup Command of `./codeship/setup.sh`
- Give it a Test Command of `./codeship/test.sh`
- Create a Deployment Pipeline for the `develop` branch with this command:
`./codeship/deploy-dev.sh`
- Create a Deployment Pipeline for the `master` branch with this command:
`./codeship/deploy-prod.sh`
- Provide `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables
with the credentials of the AWS IAM user that Serverless (running on Codeship)
should act as when deploying this API.

## Automated Backups ##
While DynamoDB supports On Demand backups as well as Continuous Backups with
Point-in-time Recovery (PITR), both of these methods [restore to a new
Expand Down Expand Up @@ -328,7 +313,7 @@ terraform taint module.serverless-user.aws_iam_access_key.serverless
```
2. Run a new plan on Terraform Cloud
3. Review the new plan and apply if it is correct
4. Copy the new key and secret from the Terraform output into Codeship
4. Copy the new key and secret from the Terraform output into GitHub Repository Secrets
## Glossary
Expand Down
18 changes: 0 additions & 18 deletions codeship/deploy.sh

This file was deleted.

10 changes: 0 additions & 10 deletions codeship/setup.sh

This file was deleted.

15 changes: 0 additions & 15 deletions codeship/test.sh

This file was deleted.

11 changes: 0 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"dependencies": {
"aws-sdk": "^2.1039.0",
"bcryptjs": "^2.4.3",
"crypto-js": "^3.3.0",
"qrcode": "^0.9.0",
"speakeasy": "^2.0.0",
"u2f": "^0.1.3",
Expand Down

0 comments on commit b242d75

Please sign in to comment.