style: apply php-cs-fixer #88
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: Website deployment | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
name: "🐳 Build & Deploy" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build image | |
run: | | |
TAG=`date "+%Y%m%d-%H%M%S"` | |
echo "website_tag=$TAG" >> $GITHUB_ENV | |
docker build -t hub.laravel.pt/website:$TAG . | |
docker login -u ${{ secrets.DEPLOY_USER }} -p ${{ secrets.DEPLOY_USER_PASSWORD }} hub.laravel.pt | |
docker push hub.laravel.pt/website:$TAG | |
- name: Deploy docker files | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
port: 22 | |
username: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_USER_PRIVATE_KEY }} | |
source: "docker-compose.yml,docker-compose.override.production.yml" | |
target: "~/apps/website" | |
- name: Deploy on remote server | |
uses: fifsky/ssh-action@master | |
with: | |
command: | | |
cd apps/website | |
mv docker-compose.override.production.yml docker-compose.override.yml | |
docker login -u ${{ secrets.DEPLOY_USER }} -p ${{ secrets.DEPLOY_USER_PASSWORD }} hub.laravel.pt | |
TAG="${{ env.website_tag }}" docker-compose up -d --remove-orphans | |
docker-compose exec -T website php artisan storage:link | |
docker-compose exec -T website php artisan config:cache | |
docker-compose exec -T website php artisan view:cache | |
docker-compose exec -T website php artisan route:cache | |
docker-compose exec -T website php artisan migrate --force | |
host: ${{ secrets.DEPLOY_HOST }} | |
user: ${{ secrets.DEPLOY_USER }} | |
key: ${{ secrets.DEPLOY_USER_PRIVATE_KEY }} |