diff --git a/.github/workflows/test-artifacts.yml b/.github/workflows/test-artifacts.yml new file mode 100644 index 00000000..fa60d107 --- /dev/null +++ b/.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 }} diff --git a/Dockerfile b/Dockerfile index 8d915775..da9bf5f9 100644 --- a/Dockerfile +++ b/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