Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
f-bguiga authored Jan 31, 2024
1 parent d0f151b commit d7d466c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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

0 comments on commit d7d466c

Please sign in to comment.