forked from mHealthKenya/ushauri_dashboard
-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
c116d0e
commit 29e7e99
Showing
1 changed file
with
42 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: deploy to test instance | ||
on: | ||
push: | ||
branches: [ encryption ] | ||
jobs: | ||
|
||
build: | ||
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote connection | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USERNAME }} | ||
key: ${{ secrets.CICD_SECRET }} | ||
port: ${{ secrets.PORT }} | ||
script: | | ||
cd /apps/github-workflows/mhealth-apps/encryption | ||
sudo rm -rf ushauri_dashboard | ||
sudo mkdir ushauri_dashboard | ||
sudo chown -R cicd2:cicd2 ushauri_dashboard | ||
git config --global --add safe.directory /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
cd ushauri_dashboard | ||
git clone -b main https://github.com/palladiumkenya/ushauri_dashboard.git . | ||
git status | ||
cp /apps/configs/ushauri-dashboard/.env /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
cp /apps/configs/ushauri-dashboard/docker-compose.yml /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
cp /apps/configs/ushauri-dashboard/nginx.dockerfile /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
cp /apps/configs/ushauri-dashboard/php.dockerfile /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
cp -r /apps/configs/ushauri-dashboard/nginx /apps/github-workflows/mhealth-apps/encryption/ushauri_dashboard/ | ||
docker-compose down | ||
docker-compose rm -fv | ||
docker-compose --env-file .env up -d --build | ||
# execute normal laravel commands | ||
docker-compose exec -T php composer install --ignore-platform-reqs --no-dev | ||
docker-compose exec -T php php artisan config:cache | ||
docker-compose exec -T php php artisan view:cache | ||
docker-compose exec -T php chmod -R 777 storage/ | ||
docker-compose exec -T php php artisan config:cache | ||
docker-compose exec -T php php artisan config:clear | ||
echo "done!" |