Use scp to deploy binaries to fileserver

This commit is contained in:
Matthew R Kasun 2022-02-11 08:57:31 -05:00 committed by GitHub
parent acef10991b
commit d9466f4847
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,18 +38,51 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: build client - name: build client
run: | run: |
cd netclient cd netclient
go build -ldflags="-X 'main.version=testing'" . go build -ldflags="-X 'main.version=testing'" -o build/netclient
curl -H 'Authorization: Bearer ${{ secrets.NUSAK_MASTERKEY }}' \ - name: deploy
-H 'Content-Type: multipart/form-data' --form upload='./netclient' \ uses: mdallasanta/ssh-scp-deploy@v1.1.0
-X POST https://dashboard.nusak.ca/api/file/netclient with:
#deploy: local: ./build/netmaker # Local file path - REQUIRED false - DEFAULT ./
#runs-on: ubuntu-latest remote: /var/www/files/testing/ # Remote file path - REQUIRED false - DEFAULT ~/
#steps: host: fileserver.clustercat.com # Remote server address - REQUIRED true
#- name: Deploy Testing Server and Client(s) #port: ${{secrets.PORT}} # Remote server port - REQUIRED false - DEFAULT 22
# run: | user: root # Remote server user - REQUIRED true
# curl -X POST https://api.github.com/mattkasun/terraform-test/dispatches \ #password: ${{secrets.PASSWORD}} # User password - REQUIRED at least one of "password" or "key"
# -H 'Accept: application/vnd.github.everest-preview+json' \ key: ${{secrets.TESTING_SSH_KEY}} # Remote server private key - REQUIRED at least one of "password" or "key"
# -u ${{ secrets.ACCESS_TOKEN }} #pre_upload: echo "This will be executed before the upload!" # Command to run via ssh before scp upload - REQUIRED false
#post_upload: echo "This will be executed after the upload!" # Command to run via ssh after scp upload - REQUIRED false
#ssh_options: -o StrictHostKeyChecking=no # A set of ssh_option separated by -o - REQUIRED false - DEFAULT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
#scp_options: -v # Flags to use during scp - REQUIRED false - DEFAULT ''
netmaker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: build server
run:
go build -ldflags="-X 'main.version=testing'" -o build/netmaker
- name: deploy
uses: mdallasanta/ssh-scp-deploy@v1.1.0
with:
local: ./build/netmaker # Local file path - REQUIRED false - DEFAULT ./
remote: /var/www/files/testing/ # Remote file path - REQUIRED false - DEFAULT ~/
host: fileserver.clustercat.com # Remote server address - REQUIRED true
#port: ${{secrets.PORT}} # Remote server port - REQUIRED false - DEFAULT 22
user: root # Remote server user - REQUIRED true
#password: ${{secrets.PASSWORD}} # User password - REQUIRED at least one of "password" or "key"
key: ${{secrets.TESTING_SSH_KEY}} # Remote server private key - REQUIRED at least one of "password" or "key"
#pre_upload: echo "This will be executed before the upload!" # Command to run via ssh before scp upload - REQUIRED false
#post_upload: echo "This will be executed after the upload!" # Command to run via ssh after scp upload - REQUIRED false
#ssh_options: -o StrictHostKeyChecking=no # A set of ssh_option separated by -o - REQUIRED false - DEFAULT -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
#scp_options: -v # Flags to use during scp - REQUIRED false - DEFAULT ''