Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FPO-143: Adds playbook for restoring RDS from a snapshot #5

Merged
merged 4 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading