stacker-build-push-action/.github/workflows/ci.yaml
Petu Eusebiu 093acb5ad5 ci: add publish squashfs layers
Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
2023-11-21 20:00:54 +02:00

132 lines
3.7 KiB
YAML

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
services:
registry:
image: ghcr.io/project-zot/zot-linux-amd64:latest
ports:
- 5000:5000
name: Test stacker-build-push-action
steps:
- uses: actions/checkout@v2
- name: Run stacker-build with a Dockerfile
uses: ./
with:
dockerfile: 'test/Dockerfile'
tags: v1 latest
url: docker://localhost:5000/four/app
layer-type: 'tar squashfs'
skip-tls: true
- name: Run stacker-build with all build inputs
uses: ./
with:
file: 'test/stacker.yaml'
build-args: |
SUB1=VAR1
SUB2=VAR2
SUB3=VAR3
layer-type: 'tar squashfs'
- name: Run stacker-build with only build-args
uses: ./
with:
file: 'test/stacker.yaml'
build-args: |
SUB1=VAR1
SUB2=VAR2
SUB3=VAR3
- name: Run stacker-build with only layer-type
uses: ./
with:
file: 'test/stacker_wo_subs.yaml'
layer-type: 'tar squashfs'
- name: Run stacker-build with only file input
uses: ./
with:
file: 'test/stacker_wo_subs.yaml'
- name: Run stacker-build with push and tags
uses: ./
with:
file: 'test/stacker_wo_subs.yaml'
tags: v1 latest
url: docker://localhost:5000/one/app
skip-tls: true
- name: Run stacker-build with push, tags and build-args
uses: ./
with:
file: 'test/stacker.yaml'
build-args: |
SUB1=VAR1
SUB2=VAR2
SUB3=VAR3
tags: v1 latest
url: docker://localhost:5000/two/app
skip-tls: true
- name: Run stacker-build with push, tags, build-args and layer-type
uses: ./
with:
file: 'test/stacker.yaml'
build-args: |
SUB1=VAR1
SUB2=VAR2
SUB3=VAR3
tags: v1 latest
url: docker://localhost:5000/three/app
layer-type: 'tar squashfs'
skip-tls: true
- name: Run stacker recursive-build
uses: ./
with:
dir: 'test/builds'
tags: v2
url: docker://localhost:5000/five/app
layer-type: 'tar squashfs'
skip-tls: true
- name: Run stacker-build with push, tags, build-args and layer-type(squashfs)
uses: ./
with:
file: 'test/stacker.yaml'
build-args: |
SUB1=VAR1
SUB2=VAR2
SUB3=VAR3
tags: v1 latest
url: docker://localhost:5000/six/app
layer-type: 'squashfs'
skip-tls: true
- name: Check images were published
run: |
docker pull localhost:5000/one/app/test:v1
docker pull localhost:5000/one/app/test
docker pull localhost:5000/two/app/test:v1
docker pull localhost:5000/two/app/test
docker pull localhost:5000/three/app/test:v1
docker pull localhost:5000/three/app/test
docker pull localhost:5000/four/app/app:v1
docker pull localhost:5000/four/app/app
docker pull localhost:5000/five/app/layer3_1:v2
docker pull localhost:5000/five/app/layer3_1:v2
# check squashfs
curl http://localhost:5000/v2/six/app/test/manifests/v1-squashfs
curl http://localhost:5000/v2/six/app/test/manifests/latest-squashfs
curl http://localhost:5000/v2/five/app/layer3_2/manifests/v2-squashfs
curl http://localhost:5000/v2/five/app/layer3_1/manifests/v2-squashfs