# This is a basic workflow to help you get started with Actions name: CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch on: push: branches: [ main ] pull_request: 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 "build" build: # The type of runner that the job will run on 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 - uses: actions/checkout@v2 # delete the directory - name: Clear existing directories uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST}} username: ${{ secrets.USERNAME}} password: ${{ secrets.PASSWORD}} port: ${{ secrets.PORT}} script: rm -rf public_html # copy files into public_html folder - name: Copy from Repo to Linux Lab uses: garygrossgarten/github-action-scp@v0.5.3 with: # Path to the local folder you want to copy. local: public_html # Path on the remote server to copy to. remote: public_html # Hostname or IP address of the server. host: ${{ secrets.HOST}} # Username for authentication. username: ${{ secrets.USERNAME}} # Port number of the server. port: ${{ secrets.PORT}} # Password for password-based user authentication. password: ${{ secrets.PASSWORD }} # Set proper permission as everything by default is blocked - name: Set Permissions uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST}} username: ${{ secrets.USERNAME}} password: ${{ secrets.PASSWORD}} port: ${{ secrets.PORT}} script: | pwd chmod 711 ~ chmod 755 -R public_html