Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Surfer
  3. Github Actions documentation/example for Surfer

Github Actions documentation/example for Surfer

Scheduled Pinned Locked Moved Unsolved Surfer
5 Posts 3 Posters 530 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • bmannB Offline
    bmannB Offline
    bmann
    wrote on last edited by
    #1

    I'd like to auto deploy some code from a Github repo, using Github actions after a commit happens, to copy files to Surfer.

    Has anyone documented this?

    1 Reply Last reply
    0
    • nebulonN Away
      nebulonN Away
      nebulon
      Staff
      wrote on last edited by
      #2

      I don't have any example on hand, but would also be curious how this looks like. Never set up custom Github actions as such. I would assume the surfer cli or just the rest API would be utilized?

      1 Reply Last reply
      0
      • nebulonN nebulon marked this topic as a question on
      • fbartelsF Offline
        fbartelsF Offline
        fbartels
        App Dev
        wrote on last edited by
        #3

        I did not test it, as all my ci is still either in Drone at home or Gitlab at work. But from my understanding it should look like this:

            - name: Deploy to Surfer
              uses: addnab/docker-run-action@v3
              with:
                image: git.9wd.eu/9wd/surfer-action:latest
                run: |
                  surfer --version
                  surfer put --token $SURFTOKEN --server $SURFURL public/* /
        

        (the referenced container is the surfer image I built and have been using for years)

        bmannB 1 Reply Last reply
        4
        • fbartelsF fbartels

          I did not test it, as all my ci is still either in Drone at home or Gitlab at work. But from my understanding it should look like this:

              - name: Deploy to Surfer
                uses: addnab/docker-run-action@v3
                with:
                  image: git.9wd.eu/9wd/surfer-action:latest
                  run: |
                    surfer --version
                    surfer put --token $SURFTOKEN --server $SURFURL public/* /
          

          (the referenced container is the surfer image I built and have been using for years)

          bmannB Offline
          bmannB Offline
          bmann
          wrote on last edited by bmann
          #4

          @fbartels awesome, thank you! Will try this out.

          Update: very close!

          Using server https://localhost.dwebyvr.org
          node:fs:1659
            const stats = binding.stat(
                                  ^
          Error: ENOENT: no such file or directory, stat '/website/*'
              at Object.statSync (node:fs:1659:25)
              at collectFiles (/usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:60:19)
              at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:225:40
              at Array.forEach (<anonymous>)
              at Command.put (/usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:221:15)
              at Command.listener [as _actionHandler] (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:494:17)
              at /usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1296:65
              at Command._chainOrCall (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1193:12)
              at Command._parseCommand (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1296:27)
              at /usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1082:27 {
            errno: -2,
            code: 'ENOENT',
            syscall: 'stat',
            path: '/website/*'
          }
          

          So somehow have to give it context of the checked out repo I guess?

          Here's the file in the repo I'm working with: https://github.com/DWebYVR/localhost_vancouver_webring/blob/main/.github/workflows/surfer.yml

          fbartelsF 1 Reply Last reply
          0
          • bmannB bmann

            @fbartels awesome, thank you! Will try this out.

            Update: very close!

            Using server https://localhost.dwebyvr.org
            node:fs:1659
              const stats = binding.stat(
                                    ^
            Error: ENOENT: no such file or directory, stat '/website/*'
                at Object.statSync (node:fs:1659:25)
                at collectFiles (/usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:60:19)
                at /usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:225:40
                at Array.forEach (<anonymous>)
                at Command.put (/usr/local/lib/node_modules/cloudron-surfer/cli/actions.js:221:15)
                at Command.listener [as _actionHandler] (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:494:17)
                at /usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1296:65
                at Command._chainOrCall (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1193:12)
                at Command._parseCommand (/usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1296:27)
                at /usr/local/lib/node_modules/cloudron-surfer/node_modules/commander/lib/command.js:1082:27 {
              errno: -2,
              code: 'ENOENT',
              syscall: 'stat',
              path: '/website/*'
            }
            

            So somehow have to give it context of the checked out repo I guess?

            Here's the file in the repo I'm working with: https://github.com/DWebYVR/localhost_vancouver_webring/blob/main/.github/workflows/surfer.yml

            fbartelsF Offline
            fbartelsF Offline
            fbartels
            App Dev
            wrote on last edited by
            #5

            @bmann said in Github Actions documentation/example for Surfer:

            /website/*

            This is a bit weird. In the output above it complains that it cannot find /website/, while in your yaml you are passing website/. The first one would be no surprise if it does not work, the second one however should work as ci tools usually open a shell where you will be directly in your git checkout.

            I would try to debug this with inserting a few ls and pwd into your yaml to see where you actually are and if this might be a permission issue of some kind.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search