Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test github secret system #6

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 24 additions & 21 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
name: Instabot Deployment

on:
push:
branches:
- main
release:
types: [ published ]
#on:
# push:
# branches:
# - main
# release:
# types: [ published ]

jobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Rsync files to Server
run: |
rsync -avz --exclude '/vendor' --exclude '/node_modules' --exclude '/var' ./ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_TARGET }}

- name: Install dependencies and compile assets on prod server
- uses: actions/checkout@v4
- name: Deploy to Server
run: |
ssh -i ${{ secrets.SSH_PRIVATE_KEY }} ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }} -p 22 << EOF
cd ${{ secrets.REMOTE_TARGET }}
composer install --no-dev --optimize-autoloader
php bin/console cache:clear --no-warmup --env=prod
php bin/console cache:warmup --env=prod
EOF
echo "Deploying to server"
echo "host name is : ${{ secrets.REMOTE_HOST }}"
echo "Deployed to server"
# uses: easingthemes/ssh-deploy@main
# with:
# SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
# ARGS: "-rlgoDzvc -i --delete"
# REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
# REMOTE_USER: ${{ secrets.REMOTE_USER }}
# TARGET: ${{ secrets.REMOTE_TARGET }}
# EXCLUDE: "/dist/, /node_modules/, /vendor/, /var/"
# SCRIPT_AFTER: |
# whoami
# ls -al
# echo $RSYNC_STDOUT
Loading