Created
January 20, 2024 08:31
-
-
Save atakde/373d434db6ec0ff3c55365b3b3a54edc to your computer and use it in GitHub Desktop.
PHP FTP Github Action
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
on: push | |
name: π Deploy website on push | |
jobs: | |
web-deploy: | |
name: π Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Get latest code | |
uses: actions/checkout@v3 | |
- name: PHP Version | |
run: php --version | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Get Composer cache directory | |
id: composer-cache | |
#run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Composer vendor directory | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install PHP dependencies | |
run: composer install --no-progress --no-dev --optimize-autoloader | |
- name: π Sync files | |
uses: SamKirkland/[email protected] | |
with: | |
server: ${{ secrets.FTP_SERVER }} | |
username: ${{ secrets.FTP_USERNAME }} | |
password: ${{ secrets.FTP_PASSWORD }} | |
local-dir: ./ | |
server-dir: ./api/ | |
log-level: verbose | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment