Skip to content

Commit

Permalink
Try another approach
Browse files Browse the repository at this point in the history
  • Loading branch information
snh committed Sep 8, 2024
1 parent 5110a0f commit 4e7a113
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,11 @@ jobs:
matrix:
platform: [linux/amd64, linux/386, linux/arm64, linux/arm/v6, linux/arm/v7]
steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Declare platform
run: |
platform=${{ matrix.platform }}
echo "PLATFORM=${platform//\//-}" >> $GITHUB_ENV
- name: Create pip cache directory
run: mkdir -p /tmp/pip-cache

- name: Cache pip artifacts
uses: actions/cache@v4
with:
path: /tmp/pip-cache
key: pip-cache-${{ env.PLATFORM }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
pip-cache-${{ env.PLATFORM }}-
- name: Setup QEMU
uses: docker/setup-qemu-action@v3

Expand All @@ -60,9 +46,10 @@ jobs:
uses: docker/build-push-action@v6
with:
platforms: ${{ matrix.platform }}
build-contexts: pip-cache=/tmp/pip-cache
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,name=ghcr.io/${{ github.repository }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' && 'true' || 'false' }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM }}
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache-${{ env.PLATFORM }},mode=max

- name: Export digest
if: ${{ github.event_name != 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ COPY auto_rx/requirements.txt \
/root/radiosonde_auto_rx/auto_rx/requirements.txt

# Install Python packages.
RUN --mount=type=cache,target=/root/.cache/pip,from=pip-cache pip3 install \
RUN pip3 install \
--user --break-system-packages --no-warn-script-location --ignore-installed \
-r /root/radiosonde_auto_rx/auto_rx/requirements.txt

Expand Down

0 comments on commit 4e7a113

Please sign in to comment.