mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
72 lines
2.0 KiB
YAML
72 lines
2.0 KiB
YAML
name: build-dev
|
|
|
|
on:
|
|
push:
|
|
branches: [ dev ]
|
|
jobs:
|
|
build:
|
|
name: Create cross-platform dev build
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v2
|
|
with:
|
|
go-version: 1.17
|
|
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
- name: Build
|
|
env:
|
|
RELEASE: v1.0.${{ github.run_number }}
|
|
ArmoBEServer: api.armo.cloud
|
|
ArmoERServer: report.euprod1.cyberarmorsoft.com
|
|
ArmoWebsite: portal.armo.cloud
|
|
CGO_ENABLED: 0
|
|
run: python3 --version && python3 build.py
|
|
|
|
- name: Smoke Testing
|
|
env:
|
|
RELEASE: v1.0.${{ github.run_number }}
|
|
KUBESCAPE_SKIP_UPDATE_CHECK: "true"
|
|
run: python3 smoke_testing/init.py ${PWD}/build/${{ matrix.os }}/kubescape
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: kubescape-${{ matrix.os }}
|
|
path: build/${{ matrix.os }}/kubescape
|
|
|
|
|
|
build-docker:
|
|
name: Build docker container, tag and upload to registry
|
|
needs: build
|
|
if: ${{ github.repository == 'armosec/kubescape' }}
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Set name
|
|
run: echo quay.io/armosec/kubescape:dev-v1.0.${{ github.run_number }} > build_tag.txt
|
|
|
|
- name: Build the Docker image
|
|
run: docker build . --file build/Dockerfile --tag $(cat build_tag.txt) --build-arg run_number=${{ github.run_number }}
|
|
|
|
- name: Login to Quay.io
|
|
env: # Or as an environment variable
|
|
QUAY_PASSWORD: ${{ secrets.QUAYIO_REGISTRY_PASSWORD }}
|
|
QUAY_USERNAME: ${{ secrets.QUAYIO_REGISTRY_USERNAME }}
|
|
run: docker login -u="${QUAY_USERNAME}" -p="${QUAY_PASSWORD}" quay.io
|
|
|
|
- name: Push Docker image
|
|
run: |
|
|
docker push $(cat build_tag.txt)
|
|
|
|
|