Skip to content

staging

staging #8

Workflow file for this run

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: staging
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}/