Skip to content

Commit

Permalink
Merge pull request #5 from trade-tariff/FPO-143-dr-manual
Browse files Browse the repository at this point in the history
FPO-143: Adds playbook for restoring RDS from a snapshot
  • Loading branch information
willfish authored Apr 10, 2024
2 parents 991b8de + 60788c8 commit f8043dd
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 194 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml

This file was deleted.

42 changes: 0 additions & 42 deletions .github/workflows/deploy.yml

This file was deleted.

59 changes: 59 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: development

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout
default: main
type: string

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
show-progress: false
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- run: bundle exec rake
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SKIP_PROXY_PAGES: true
deploy:
runs-on: ubuntu-latest
environment: development
needs: test
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build 'build' folder ready for deployment
run: make build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install AWS CLI
id: install-aws-cli
uses: unfor19/install-aws-cli-action@master
with:
version: 2
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION}}
run: |
ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
aws s3 cp --recursive build/ s3://trade-tariff-tech-docs-${ACCOUNT_ID}/
44 changes: 44 additions & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: production

on:
workflow_run:
workflows: [staging]
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout
default: main
type: string

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: production
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build 'build' folder ready for deployment
run: make build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install AWS CLI
id: install-aws-cli
uses: unfor19/install-aws-cli-action@master
with:
version: 2
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION}}
run: |
ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
aws s3 cp --recursive build/ s3://trade-tariff-tech-docs-${ACCOUNT_ID}/
44 changes: 44 additions & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: staging

on:
workflow_run:
workflows: [development]
types: [completed]
branches: [main]
workflow_dispatch:
inputs:
ref:
description: The branch, tag or SHA to checkout
default: main
type: string

jobs:
deploy:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: production
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build 'build' folder ready for deployment
run: make build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install AWS CLI
id: install-aws-cli
uses: unfor19/install-aws-cli-action@master
with:
version: 2
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION}}
run: |
ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text)
aws s3 cp --recursive build/ s3://trade-tariff-tech-docs-${ACCOUNT_ID}/
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,10 @@
start: build
NO_CONTRACTS=true bundle exec middleman server

install:
bundle exec middleman build

test:
bundle exec rake

build: install clean
build: clean
NO_CONTRACTS=true bundle exec middleman build

clean:
Expand Down
Loading

0 comments on commit f8043dd

Please sign in to comment.