-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #796 from hackerspace-ntnu/795-fix-deploy-action-t…
…o-run-on-push fix: update the workflows
- Loading branch information
Showing
3 changed files
with
45 additions
and
46 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 |
---|---|---|
@@ -1,9 +1,7 @@ | ||
name: Deploy to Server | ||
|
||
on: | ||
pull_request: | ||
# Change to merge when implemented (still beta) | ||
types: [closed] | ||
push: | ||
branches: | ||
- master | ||
|
||
|
@@ -12,22 +10,21 @@ jobs: | |
name: Deploy | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote ssh commands using key | ||
uses: appleboy/[email protected] | ||
if: github.event.pull_request.merged == true | ||
with: | ||
host: ${{ secrets.host }} | ||
username: ${{ secrets.user }} | ||
key: ${{ secrets.id }} | ||
port: ${{ secrets.port }} | ||
script: | | ||
cd ${{ secrets.deploy_dir }} | ||
. venv-prod/bin/activate | ||
cd website | ||
git pull | ||
python -m pip install --upgrade pip | ||
pip install --upgrade --force-reinstall -r prod_requirements.txt | ||
python manage.py migrate | ||
python manage.py collectstatic --noinput | ||
python manage.py compilemessages | ||
echo "${{ secrets.dingseboms_password }}" | sudo -S systemctl restart gunicorn | ||
- name: executing remote ssh commands using key | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.host }} | ||
username: ${{ secrets.user }} | ||
key: ${{ secrets.id }} | ||
port: ${{ secrets.port }} | ||
script: | | ||
cd ${{ secrets.deploy_dir }} | ||
. venv-prod/bin/activate | ||
cd website | ||
git pull | ||
python -m pip install --upgrade pip | ||
pip install --upgrade --force-reinstall -r prod_requirements.txt | ||
python manage.py migrate | ||
python manage.py collectstatic --noinput | ||
python manage.py compilemessages | ||
echo "${{ secrets.dingseboms_password }}" | sudo -S systemctl restart gunicorn |
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
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