Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

github actions: test container build on PRs #27

Merged
merged 4 commits into from
Feb 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,32 @@ jobs:
- name: Run checks
run: make check

podmanbuild:
runs-on: ubuntu-latest
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: check free space
run: df -h
- name: build container image
# note: forcing use of podman here since we are
# using podman explicity for the push job
run: make CONTAINER_CMD=podman image-build

dockerbuild:
runs-on: ubuntu-latest
# don't run on push, since the "push" job contains the
# image build step, so no need to do it twice.
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- name: build container image
# note: forcing use of podman here since we are
# using podman explicity for the push job
run: make CONTAINER_CMD=docker image-build

# push the container to quay.io - only for pushes, not PRs
push:
needs: [build, check]
Expand All @@ -37,10 +63,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: log in to quay.io
run: podman login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io
# using docker for now, since podman has an issue with space
# consumption: image build fails with no space left on device...
run: docker login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io
- name: build container image
# note: forcing use of podman here, since we did podman login above
run: make CONTAINER_CMD=podman image-build
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker image-build
- name: push container image
# note: forcing use of podman here, since we did podman login above
run: make CONTAINER_CMD=podman container-push
# note: forcing use of docker here, since we did docker login above
run: make CONTAINER_CMD=docker container-push