Merge pull request #481 from mattkasun/testing

Updated (Renamed) workflow to produce artifacts for deployement testing
This commit is contained in:
Alex 2021-11-23 07:35:27 -05:00 committed by GitHub
commit cd67943f55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 1 deletions

51
.github/workflows/test-artifacts.yml vendored Normal file
View file

@ -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 }}

View file

@ -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