WIP: Testing policy #113
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}/ |