Browse Source

Merge pull request #481 from mattkasun/testing

Updated (Renamed) workflow to produce artifacts for deployement testing
Alex 3 years ago
parent
commit
cd67943f55
2 changed files with 52 additions and 1 deletions
  1. 51 0
      .github/workflows/test-artifacts.yml
  2. 1 1
      Dockerfile

+ 51 - 0
.github/workflows/test-artifacts.yml

@@ -0,0 +1,51 @@
+name: Build artifacts for deployment testing 
+
+on:
+    push:
+        branches:
+            - 'testing'
+    workflow_dispatch:
+
+jobs:
+    docker:
+        runs-on: ubuntu-latest
+        steps:
+            - name: Checkout
+              uses: actions/checkout@v2
+            - name: Set up QEMU
+              uses: docker/setup-qemu-action@v1
+            - name: Set up Docker Buildx
+              uses: docker/setup-buildx-action@v1
+            - name: Login to DockerHub
+              uses: docker/login-action@v1
+              with:
+                  registry: ghcr.io
+                  username: ${{ github.actor }}
+                  password: ${{ secrets.GITHUB_TOKEN }}
+            - name: Build and Push test
+              uses: docker/build-push-action@v2
+              with:
+                  context: .
+                  platforms: linux/amd64
+                  push: true
+                  tags: ghcr.io/${{ github.repository }}:testing
+    netclient:
+        runs-on: ubuntu-latest
+        steps:
+            - name: Checkout
+              uses: actions/checkout@v2
+            - name: build client
+              run: |
+                cd netclient
+                go build -ldflags="-X 'main.version=testing'" .
+                curl -H 'Authorization: Bearer ${{ secrets.NUSAK_MASTERKEY }}' \
+                -H 'Content-Type: multipart/form-data' --form upload='./netclient' \
+                -X POST https://dashboard.nusak.ca/api/file/netclient
+    #deploy:
+         #runs-on: ubuntu-latest
+         #steps:
+            #- name: Deploy Testing Server and Client(s)
+            #  run: |
+            #      curl -X POST https://api.github.com/mattkasun/terraform-test/dispatches \
+            #      -H 'Accept: application/vnd.github.everest-preview+json' \
+            #      -u ${{ secrets.ACCESS_TOKEN }} 

+ 1 - 1
Dockerfile

@@ -7,7 +7,7 @@ COPY . .
 
 ENV GO111MODULE=auto
 
-RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=1 /usr/local/go/bin/go build -ldflags="-w -s" -o netmaker main.go
+RUN GOOS=linux CGO_ENABLED=1 /usr/local/go/bin/go build -ldflags="-w -s" -o netmaker main.go
 
 FROM alpine:3.13.6
 # add a c lib