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

Commit adc4bb1

Browse files
authored
Deploy only on push v* tags (#25)
1 parent 92a3ec0 commit adc4bb1

2 files changed

Lines changed: 31 additions & 25 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
needs: laravel_tests
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
- name: Deployment
16+
uses: appleboy/ssh-action@master
17+
with:
18+
host: ${{ secrets.SSH_HOST }}
19+
username: web
20+
password: ${{ secrets.SSH_PASSWORD }}
21+
# TODO composer install --allow-root --no-interaction
22+
script: |
23+
whoami
24+
cd /var/www/web/sites/secretnotes.ru
25+
git reset --hard HEAD
26+
git clean -f -d
27+
git pull origin main
28+
git show --summary
29+
composer -V
Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Laravel
1+
name: test
22

33
on:
44
push:
@@ -14,7 +14,7 @@ jobs:
1414
image: mysql:5.7
1515
env:
1616
MYSQL_ROOT_PASSWORD: password
17-
MYSQL_DATABASE:
17+
MYSQL_DATABASE: secretnotes
1818
ports:
1919
- 33306:3306
2020
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
@@ -46,26 +46,3 @@ jobs:
4646
run: npm install
4747
- name: Compile assets for production
4848
run: npm run production
49-
50-
# TODO Запускать только на релизах
51-
deploy:
52-
runs-on: ubuntu-latest
53-
needs: laravel_tests
54-
steps:
55-
- name: Checkout
56-
uses: actions/checkout@v2
57-
- name: Deployment
58-
uses: appleboy/ssh-action@master
59-
with:
60-
host: ${{ secrets.SSH_HOST }}
61-
# key: ${{ secrets.SSH_PRIVATE_KEY }}
62-
username: web
63-
password: ${{ secrets.SSH_PASSWORD }}
64-
# TODO composer install --allow-root --no-interaction
65-
script: |
66-
whoami
67-
cd /var/www/web/sites/secretnotes.ru
68-
git reset --hard HEAD
69-
git clean -f -d
70-
git pull origin main
71-
git show --summary

0 commit comments

Comments
 (0)