Last active
August 3, 2021 17:14
-
-
Save jscul/4588348d387ffa195eda50093ac51770 to your computer and use it in GitHub Desktop.
Build React App/Deploy EB On Push
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 React App/Deploy EB On Push | |
on: | |
push: | |
branches: | |
- production | |
- development | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Initialize | |
id: vars | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- name: Install | |
run: yarn --cwd client install | |
- name: Build | |
run: CI='' yarn --cwd client build && mv -f client/build server/static | |
- name: Prepare | |
run: cd server && zip -r deploy.zip * && cd .. | |
- name: Deploy | |
uses: einaregilsson/beanstalk-deploy@v16 | |
with: | |
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
application_name: ${{ secrets.AWS_APPLICATION }} | |
environment_name: ${{ steps.vars.outputs.short_ref }} | |
version_label: ${{ github.sha }} | |
region: ${{ secrets.AWS_REGION }} | |
deployment_package: server/deploy.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment