Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
SethSharp committed Dec 6, 2023
1 parent b0c397a commit df96e2e
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
run: php -r "file_exists('.env') || copy('.env.production.example', '.env');"

- name: Copy staging example .env
if: github.ref == 'refs/develop'
if: github.ref == 'refs/heads/develop'
run: php -r "file_exists('.env') || copy('.env.staging.example', '.env');"

- name: Copy example .env
if: github.ref != 'refs/heads/main' && github.ref != 'refs/develop'
if: github.ref != 'refs/heads/main' && github.ref != 'refs/heads/develop'
run: php -r "file_exists('.env') || copy('.env.example', '.env');"

- name: Generate key
Expand All @@ -68,37 +68,30 @@ jobs:
DB_PASSWORD: root
run: php artisan test

- name: Clear Cache
run: |
php artisan cache:clear
php artisan route:clear
php artisan view:clear
php artisan config:clear
- name: Echo DB infor to env
if: github.ref == 'refs/develop'
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: Echo DB information to env
# if: github.ref == 'refs/develop'
# 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
if: github.ref == 'refs/heads/main' || github.ref == 'refs/develop'
run: zip -r deploy.zip ./ -x "node_modules/*" -x "vendor/*" -x "tests/*"

- name: Deploy to Staging Environment
if: github.ref == 'refs/develop'
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.STAGING_AWS_ACCESS_KEY }}
aws_secret_key: ${{ secrets.STAGING_AWS_SECRET_KEY }}
application_name: "FramedJustForYou"
environment_name: FramedJustForYou-env
existing_bucket_name: ${{ secrets.STAGING_AWS_BUCKET_NAME }}
region: ap-southeast-2
version_label: ${{ github.sha }}
deployment_package: deploy.zip
# - name: Deploy to Staging Environment
# if: github.ref == 'refs/develop'
# uses: einaregilsson/beanstalk-deploy@v18
# with:
# aws_access_key: ${{ secrets.STAGING_AWS_ACCESS_KEY }}
# aws_secret_key: ${{ secrets.STAGING_AWS_SECRET_KEY }}
# application_name: "FramedJustForYou"
# environment_name: FramedJustForYou-env
# existing_bucket_name: ${{ secrets.STAGING_AWS_BUCKET_NAME }}
# region: ap-southeast-2
# version_label: ${{ github.sha }}
# deployment_package: deploy.zip

- name: Deploy to Production Environment
if: github.ref == 'refs/heads/main'
Expand Down

0 comments on commit df96e2e

Please sign in to comment.