Skip to content

Attempt to build container #10

Attempt to build container

Attempt to build container #10

Workflow file for this run

name: Container
on:
# push:
# branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
env:
IMAGE_NAME: pynucleus
IMAGE_TAGS: latest ${{ github.sha }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
jobs:
container-build:
runs-on: ubuntu-latest
timeout-minutes: 300
outputs:
image: ${{ steps.build_image.outputs.image }}
tag: ${{ steps.build_image.outputs.tag }}
steps:
- name: Check out
if: always()
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: hadolint/[email protected]
with:
dockerfile: Dockerfile
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.IMAGE_TAGS }}
containerfiles: |
./Dockerfile
container-test:
runs-on: ubuntu-latest
timeout-minutes: 300
needs: container-build
container:
image: ${{ needs.container-build.outputs.image }}:${{ github.sha }}
steps:
- name: Run tests
if: always()
run: python3 -m pytest --junit-xml=test-results.xml tests/
- name: Report test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Test report (Container)
path: test-results.xml
reporter: java-junit
fail-on-error: true
container-push:
runs-on: ubuntu-latest
needs:
- container-build
- container-test
steps:
- name: Push To GHCR
uses: redhat-actions/push-to-registry@v2
id: push
with:
image: ${{ needs.container-build.outputs.image }}
tags: ${{ needs.container-build.outputs.tags }}
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
extra-args: |
--disable-content-trust
- name: Echo outputs
run: |
echo "${{ toJSON(steps.push.outputs) }}"