Created
August 24, 2021 01:10
-
-
Save plencovich/884351fe6730e42e5d8b1425ac4e30a8 to your computer and use it in GitHub Desktop.
Deploy a servidor por FTP
This file contains hidden or 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: 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/[email protected] | |
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/[email protected] | |
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