Skip to content

feat(ci): add action to push test images (#30) #1

feat(ci): add action to push test images (#30)

feat(ci): add action to push test images (#30) #1

Workflow file for this run

name: push
on:
push:
branches:
- master
env:
TEST_IMAGE: 'ghcr.io/${{ github.repository_owner }}/trivy-test-images' # used in Makefile
GH_USER: "aqua-bot"
jobs:
changed_files:
runs-on: ubuntu-latest
name: Push changed images
steps:
- uses: actions/checkout@v3
- name: Login to ghcr.io registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ env.GH_USER }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v4
- name: Get changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v37
with:
files_yaml: |
busybox:
- 'busybox-with-lockfile/**'
containerd:
- 'containerd/**'
spring4shell:
- 'spring4shell/**'
crane-images:
- push-crane-images.sh
- name: Push `busybox-with-lockfile` image
if: steps.changed-files-yaml.outputs.busybox_any_changed == 'true'
run: make build-busybox
- name: Push `containerd` image
if: steps.changed-files-yaml.outputs.containerd_any_changed == 'true'
run: make build-containerd
- name: Push `spring4shell` image
if: steps.changed-files-yaml.outputs.spring4shell_any_changed == 'true'
run: make build-spring4shell
- name: Copy images
if: steps.changed-files-yaml.outputs.crane-images_any_changed == 'true'
run: make copy-images