Merge pull request #90 from p4lang/dependabot/pip/packages/p4pi-web/t… #29
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
name: Build image on push or PR | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- 'pi-gen/**' | |
- 'packages/**' | |
- '.github/workflows/on-push.yml' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
working-directory: pi-gen | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Register binfmt_misc entries | |
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
- name: Run build script | |
run: sudo PIGEN_DOCKER_OPTS="-e DEPLOY_XZ=1" ./build-docker.sh | |
- name: List deploy directory | |
run: ls -al deploy/ | |
- name: Set image name | |
run: | | |
IMAGE_NAME="p4pi-$(date +'%Y-%m-%d')-$(git rev-parse --short=8 HEAD)" | |
echo "IMAGE_NAME=$IMAGE_NAME" >> $GITHUB_ENV | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.IMAGE_NAME }} | |
path: pi-gen/deploy/*.zip | |
if-no-files-found: error | |
retention-days: 90 |