Nickez/build container in ci #9
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See reference docs at | |
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions | |
name: Pull request CI | |
on: pull_request | |
jobs: | |
pr-ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Clone the repo | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Check if container files was modified and if container version already exists | |
id: checks | |
run: | | |
./.ci/check-container-sources-modified >> "$GITHUB_OUTPUT" | |
./.ci/check-container-version-published >> "$GITHUB_OUTPUT" | |
- name: Build container image | |
if: steps.checks.outputs.modified == 'true' | |
run: | | |
if "${{ steps.checks.outputs.container-published }}" == "true"; then | |
echo "::error::Container modified but version $(cat .containerversion) already published" | |
exit 1 | |
fi | |
./.ci/build-container | |
- name: Pull container image | |
run: ./.ci/pull-container | |
- name: Run CI in container | |
env: | |
COMPARE_REV: ${{ format('origin/{0}', github.base_ref) }} | |
run: ./.ci/run-container-ci ${{github.workspace}} |