Merge pull request #7 from wpears/fe-and-artifact #9
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: 'Build cf.gov artifact' | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
Build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v3 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Install dependencies | |
run: yarn | |
- name: Build frontend | |
run: yarn run build | |
- name: Run the build process with Docker | |
uses: addnab/docker-run-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
image: ${{ github.repository }}-builder:main | |
options: -v ${{ github.workspace }}:/cfgov | |
run: ./_build.sh | |
- name: Upload arifact | |
uses: keithweaver/aws-s3-github-action@v1.0.0 | |
with: | |
command: cp | |
source: cfgov_current_build.zip | |
destination: s3://${{ secrets.BUCKET }}/cfgov_${{ github.sha }}_build.zip | |
aws_access_key_id: ${{ secrets.BUILD_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.BUILD_SECRET_ACCESS_KEY }} | |
aws_region: us-east-1 |