Created
September 8, 2021 20:56
-
-
Save mahdyar/2b99f57e30ce28a459dcc728a1893e68 to your computer and use it in GitHub Desktop.
Deploy to cPanel with GitHub Actions (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 to cPanel | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| FTP-Deploy-Action: | |
| name: FTP-Deploy-Action | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/[email protected] | |
| with: | |
| fetch-depth: 2 | |
| # Deploy to cPanel | |
| - name: FTP-Deploy-Action | |
| uses: SamKirkland/[email protected] | |
| with: | |
| ftp-server: ${{ secrets.FTP_SERVER }} | |
| ftp-username: ${{ secrets.FTP_USERNAME }} | |
| ftp-password: ${{ secrets.FTP_PASSWORD }} | |
| # Purge CF's cache (optional) | |
| - name: Purge cache | |
| uses: jakejarvis/cloudflare-purge-action@master | |
| env: | |
| CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
| CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should create secrets
FTP_SERVER,FTP_USERNAMEandFTP_PASSWORD.If your service is behind Cloudflare and you want to purge its cache with GitHub Actions as well, then you should create secrets
CLOUDFLARE_ZONEandCLOUDFLARE_TOKEN, otherwise remove lines21to26.