Skip to content

Commit

Permalink
deploy step
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp authored Jul 26, 2024
1 parent aaf87db commit 47c9e77
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,62 +65,3 @@ jobs:
DB_USERNAME: root
DB_PASSWORD: root
run: php artisan test

deploy-staging:
needs: tests

if: github.ref == 'refs/heads/main'

runs-on: ubuntu-22.04

environment: staging

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: zip, sqlite3
coverage: none

- name: Install node dependencies
run: npm i

- name: Copy .env
run: |
if [ -f .env ]; then
echo "File .env exists"
else
echo "File .env does not exist"
php -r "copy('.env.staging.example', '.env');"
fi
- name: Install composer dependencies
run: composer install --no-cache --no-ansi --no-interaction --no-progress

- name: Generate key
run: php artisan key:generate

- name: Echo DB credentials to .env
run: |
echo "DB_HOST=${{ secrets.DB_HOST}}" >> .env
echo "DB_DATABASE=${{ secrets.DB_DATABASE}}" >> .env
echo "DB_USERNAME=${{ secrets.DB_USERNAME}}" >> .env
echo "DB_PASSWORD=${{ secrets.DB_PASSWORD}}" >> .env
- name: Build ZIP Deployment Package
run: zip -r deploy.zip ./ -x "node_modules/*" -x "vendor/*" -x "tests/*"

- name: Deploy to Staging Elastic Beanstalk
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
application_name: "Habit Tracker"
environment_name: HabitTracker-UC-1
existing_bucket_name: elasticbeanstalk-ap-southeast-2-290427685328
region: ap-southeast-2
version_label: ${{ github.sha }}
deployment_package: deploy.zip

0 comments on commit 47c9e77

Please sign in to comment.