-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
32 additions
and
25 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,56 @@ | ||
name: Deploy React Book App from GitHub to AWS Elastic Beanstalk | ||
name: Dev deployment from Github to AWS | ||
on: | ||
# activates the workflow when there is a push on the main branch | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest # the OS your job should run on | ||
strategy: | ||
matrix: | ||
node-version: [16.x] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Latest Repo | ||
# checks out your repository under the GitHub workspace so that your workflow can access it | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@master | ||
|
||
- name: Generate Deployment Package | ||
# zip all files except .git | ||
run: zip -r BookAppFrontend.zip * -x "**.git**" | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Get timestamp | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: Dockerfile.prod | ||
push: true | ||
tags: VideoChat-Productivity-React-Firebase/VideoChat:latest | ||
|
||
- name: Get Timestamp | ||
uses: gerred/actions/current-time@master | ||
id: current-time | ||
|
||
- name: Run string replace | ||
- name: Run String Replace | ||
uses: frabert/replace-string-action@master | ||
id: format-time | ||
with: | ||
# replaces '[:\.]+' in the timestamp with '-' | ||
pattern: '[:\.]+' | ||
string: "${{ steps.current-time.outputs.time }}" | ||
replace-with: "-" | ||
flags: "g" | ||
|
||
- name: Generate Deployment Package | ||
run: zip -r deploy.zip * -x "**node_modules**" | ||
|
||
- name: Deploy to EB | ||
uses: einaregilsson/beanstalk-deploy@v21 | ||
uses: einaregilsson/beanstalk-deploy@v16 | ||
with: | ||
# input the credentials you used to setup AWS CLI and credentials for the application environment | ||
aws_access_key: "${{ secrets.AWS_ACCESS_KEY_ID }}" | ||
aws_secret_key: "${{ secrets.AWS_SECRET_ACCESS_KEY}}" | ||
application_name: ProductivityChat | ||
environment_name: ProductivityChat-env | ||
version_label: "app-${{ steps.format-time.outputs.replaced }}" | ||
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
application_name: VideoChat | ||
environment_name: VideoChat-env | ||
version_label: "docker-app-${{ steps.format-time.outputs.replaced }}" | ||
region: us-east-1 | ||
deployment_package: BookAppFrontend.zip | ||
|
||
- name: Deployed! | ||
run: echo App deployed to ELB | ||
deployment_package: deploy.zip |
Empty file.