Skip to content

Instantly share code, notes, and snippets.

@plencovich
Created August 24, 2021 01:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plencovich/884351fe6730e42e5d8b1425ac4e30a8 to your computer and use it in GitHub Desktop.
Save plencovich/884351fe6730e42e5d8b1425ac4e30a8 to your computer and use it in GitHub Desktop.
Deploy a servidor por FTP
name: deploy-production
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: ./private_html/vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Get npm cache directory
uses: actions/cache@v2
with:
path: |
~/cache
!~/cache/exclude
**/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Install Composer dependencies
working-directory: ./private_html
if: steps.composer-cache.outputs.cache-hit != 'true'
run: composer install --prefer-dist --no-scripts --ignore-platform-reqs --no-progress --optimize-autoloader --no-interaction
- name: Install NPM dependencies
run: npm install --silent
- name: Compile assets
run: npm run production
- name: Sync files PRIVATE_HTML
uses: SamKirkland/FTP-Deploy-Action@4.0.0
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./private_html/
server-dir: ./private_html/
exclude: .git*
- .git*/**
- **/.git*/**
- node_modules/**
- node_modules/**/*
- .vscode/**
- app/config/development/config.php
- app/config/testing/config.php
- name: Sync files HTTPDOCS
uses: SamKirkland/FTP-Deploy-Action@4.0.0
with:
server: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ./httpdocs/
server-dir: ./httpdocs/
exclude: .env*
- media/**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment