Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Commit

Permalink
Deploy only on push v* tags (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomzyakov authored Apr 29, 2022
1 parent 92a3ec0 commit adc4bb1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: deploy

on:
push:
tags:
- 'v*'

jobs:
deploy:
runs-on: ubuntu-latest
needs: laravel_tests
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deployment
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: web
password: ${{ secrets.SSH_PASSWORD }}
# TODO composer install --allow-root --no-interaction
script: |
whoami
cd /var/www/web/sites/secretnotes.ru
git reset --hard HEAD
git clean -f -d
git pull origin main
git show --summary
composer -V
27 changes: 2 additions & 25 deletions .github/workflows/laravel.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Laravel
name: test

on:
push:
Expand All @@ -14,7 +14,7 @@ jobs:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE:
MYSQL_DATABASE: secretnotes
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
Expand Down Expand Up @@ -46,26 +46,3 @@ jobs:
run: npm install
- name: Compile assets for production
run: npm run production

# TODO Запускать только на релизах
deploy:
runs-on: ubuntu-latest
needs: laravel_tests
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deployment
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
# key: ${{ secrets.SSH_PRIVATE_KEY }}
username: web
password: ${{ secrets.SSH_PASSWORD }}
# TODO composer install --allow-root --no-interaction
script: |
whoami
cd /var/www/web/sites/secretnotes.ru
git reset --hard HEAD
git clean -f -d
git pull origin main
git show --summary

0 comments on commit adc4bb1

Please sign in to comment.