Bme villamosmernok (#130) #60
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
name: Test && Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '7.4' | |
- run: composer config --no-plugins allow-plugins.kylekatarnls/update-helper false | |
- run: composer install --profile --no-interaction | |
- run: ./vendor/bin/phpunit | |
deploy: | |
concurrency: deploy_to_master | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: tailscale/github-action@v2 | |
with: | |
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }} | |
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }} | |
tags: tag:ci | |
- run: > | |
mkdir /home/runner/.ssh && | |
mv .deploy/ssh_config /home/runner/.ssh/config && | |
echo "$ID_RSA" > /home/runner/.ssh/id_rsa && | |
chmod 600 /home/runner/.ssh/* | |
env: | |
ID_RSA: ${{ secrets.ID_RSA }} | |
- run: > | |
ssh [email protected] "sh -c ' | |
cd /var/www/targygraf.hu; | |
rm composer.lock; | |
git pull origin master && | |
composer config --no-plugins allow-plugins.kylekatarnls/update-helper false && | |
composer install --no-dev --no-interaction && | |
php artisan migrate:refresh --seed --force -vvv'" | |