diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2df01b2 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Build and Push docker images +on: + pull_request: + branches: + - main + paths: + - 'images/**' + push: + branches: + - main + paths: + - 'images/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + push-images: + strategy: + fail-fast: false + matrix: + architecture: [X64, ARM64] + runs-on: [ "self-hosted", "linux", "${{matrix.architecture}}" ] + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Login to Github Packages + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build images + working-directory: ./images + run: | + make build-all + + - name: Push images + if: ${{ github.event_name == 'push' }} + working-directory: ./images + run: | + make docker-push diff --git a/images/Makefile b/images/Makefile index 611c55c..8ed226a 100644 --- a/images/Makefile +++ b/images/Makefile @@ -1,5 +1,5 @@ DRY_RUN := false -REPOSITORY := falcosecurity/kernel-testing +REPOSITORY := ghcr.io/falcosecurity/kernel-testing ARCH ?= $(shell uname -m) YAML_FILE := images.yaml