Skip to content

Create main.yml

Create main.yml #1

Workflow file for this run

name: Test & Deploy
on:
push:
branches:
- master
jobs:
test-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Latest Repo
uses: actions/checkout@master
# Zip Dockerfile for upload
- name: Generate Deployment Package
run: zip -r deploy.zip * -x "**node_modules**"
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.]+'
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v14
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
application_name: docker-app
environment_name: Docker-app-env
version_label: "my-first-docker-deployment-${{ steps.format-time.outputs.replaced }}"
region: us-east-1
deployment_package: deploy.zip