|
|
|
@ -174,3 +174,79 @@ jobs:
|
|
|
|
|
with:
|
|
|
|
|
name: alpine_digests
|
|
|
|
|
path: digests.txt
|
|
|
|
|
|
|
|
|
|
build-and-push-docker-buster-image:
|
|
|
|
|
name: Build Docker Buster image (for PyInstsaller) and push to repositories
|
|
|
|
|
# run only when code is compiling and tests are passing
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
|
|
# steps to perform in job
|
|
|
|
|
steps:
|
|
|
|
|
- name: Checkout code
|
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
|
|
# avoid building if there are testing errors
|
|
|
|
|
- name: Run smoke test
|
|
|
|
|
run: |
|
|
|
|
|
sudo apt-get install -y libzbar0
|
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
|
pip install -U -r requirements-dev.txt
|
|
|
|
|
pip install -U .
|
|
|
|
|
pytest
|
|
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
|
uses: docker/setup-qemu-action@v2
|
|
|
|
|
|
|
|
|
|
# setup Docker build action
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
|
id: buildx
|
|
|
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
|
# Workaround for failing builds: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381
|
|
|
|
|
# TODO remove workaround when fixed
|
|
|
|
|
with:
|
|
|
|
|
driver-opts: |
|
|
|
|
|
image=moby/buildkit:v0.10.6
|
|
|
|
|
|
|
|
|
|
- name: Login to DockerHub
|
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
|
with:
|
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: Login to Github Packages
|
|
|
|
|
uses: docker/login-action@v2
|
|
|
|
|
with:
|
|
|
|
|
registry: ghcr.io
|
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
|
password: ${{ secrets.GHCR_IO_TOKEN }}
|
|
|
|
|
|
|
|
|
|
- name: "Build image from Buster and push to GitHub Container Registry"
|
|
|
|
|
id: docker_build_buster
|
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
|
uses: docker/build-push-action@v3
|
|
|
|
|
with:
|
|
|
|
|
platforms: linux/amd64,linux/arm64
|
|
|
|
|
# relative path to the place where source code with Dockerfile is located
|
|
|
|
|
# TODO file:, move to docker/
|
|
|
|
|
context: .
|
|
|
|
|
file: Dockerfile
|
|
|
|
|
# builder: ${{ steps.buildx.outputs.name }}
|
|
|
|
|
build-args: |
|
|
|
|
|
BASE_IMAGE=python:3.11-slim-buster
|
|
|
|
|
# Note: tags has to be all lower-case
|
|
|
|
|
pull: true
|
|
|
|
|
tags: |
|
|
|
|
|
scit0/extract_otp_secrets:buster
|
|
|
|
|
push: true
|
|
|
|
|
|
|
|
|
|
- name: Image digest
|
|
|
|
|
# TODO upload digests to assets
|
|
|
|
|
run: |
|
|
|
|
|
echo "extract_otp_secrets digests: ${{ steps.docker_build_qr_reader_latest.outputs.digest }}"
|
|
|
|
|
echo "${{ steps.docker_build_qr_reader_latest.outputs.digest }}" > digests.txt
|
|
|
|
|
- name: Save docker digests as artifacts
|
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
|
with:
|
|
|
|
|
name: buster_digests
|
|
|
|
|
path: digests.txt
|
|
|
|
|