From 8e5986ea4ca7a1bd59d146583943bd744ea8ef30 Mon Sep 17 00:00:00 2001 From: Gavin Morrow Date: Tue, 1 Jul 2025 11:27:08 -0400 Subject: [PATCH] Create main.yml (SFTP ci/cd) --- .github/workflows/main.yml | 59 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..8915d23 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,59 @@ +# See + +# This is a basic workflow to upload files +# from GitHub to server via GitHub Actions +name: Publish via SFTP + +# Controls when the workflow will run +on: + + # Triggers the workflow on push request event + # but only for the specific branch + push: + branches: [ main ] + +# A workflow run is made up of one or more jobs +# that can run sequentially or in parallel +jobs: + + # This workflow contains a single job called "SFTP-Deploy-Action" + SFTP-Deploy-Action: + name: SFTP-Deploy-Action + + # The type of runner that the job will run on + # (depends on server but usually this value is works) + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks + # that will be executed as part of the job + steps: + + # Checks-out your repository under $GITHUB_WORKSPACE, + # so your job can access it + - name: Checkout + uses: actions/checkout@v3 + with: + + # Fetch all history for all tags and branches + fetch-depth: 0 + + # Checkout a specific branch + ref: main + + # This is a composite GitHub Action (Linux runner) + # for deploying repository content to remote server + - name: SFTP-Deploy-Action + uses: milanmk/actions-file-deployer@master + with: + remote-protocol: sftp + + # Credentials for SFTP access to server using GitHub secrets + remote-host: ${{ secrets.SFTP_HOST }} + remote-user: ${{ secrets.SFTP_USER }} + remote-password: ${{ secrets.SFTP_PASSWORD }} + + # Path for specific folder on server for files deployment + remote-path: /home/gavin_unitytheory/gavinmorrow.com + + # Port for SFTP access to server + remote-port: 221 -- 2.51.2