Skip to content

chore(deps): bump actions/download-artifact from 5 to 6 (#6) #104

chore(deps): bump actions/download-artifact from 5 to 6 (#6)

chore(deps): bump actions/download-artifact from 5 to 6 (#6) #104

Workflow file for this run

name: Build and deploy container
on:
push:
branches:
- main
paths-ignore:
- 'LICENSE'
- 'README.md'
concurrency:
group: "package"
cancel-in-progress: false
env:
REGISTRY: ghcr.io
jobs:
build:
strategy:
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
arch_name: amd64
- platform: linux/arm64
runner: ubuntu-24.04-arm
arch_name: arm64
runs-on: ${{ matrix.runner }}
permissions:
contents: read
steps:
# Free some spaces to avoid "No space left on device" error
# https://github.com/actions/runner-images/issues/2840
# https://github.com/easimon/maximize-build-space
- name: Free some spaces
run: |
echo "Available storage:"
df -h
echo
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /hostedtoolcache/CodeQL
sudo rm -rf $AGENT_TOOLSDIRECTORY
sudo docker image prune --all --force
echo "Available storage:"
df -h
echo
- uses: actions/checkout@v5
- uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.arch_name }}
uses: docker/bake-action@v6
with:
set: |
latest.platform=${{ matrix.platform }}
latest.args.CTAN_MIRROR=https://mirrors.mit.edu/CTAN/systems/texlive/tlnet
latest.tags=latex-devcontainer:${{ matrix.arch_name }}
latest.output=type=docker,dest=/tmp/image-${{ matrix.arch_name }}.tar
- name: Split ${{ matrix.arch_name }} image
run: |
split -b 2G /tmp/image-${{ matrix.arch_name }}.tar /tmp/image-${{ matrix.arch_name }}.tar.part.
ls -la /tmp/image-${{ matrix.arch_name }}.tar.part.*
- name: Upload ${{ matrix.arch_name }} artifacts
uses: actions/upload-artifact@v5
with:
name: docker-image-${{ matrix.arch_name }}
path: /tmp/image-${{ matrix.arch_name }}.tar.part.*
create-manifest:
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
services:
registry:
image: registry:3.0.0
ports:
- 5000:5000
steps:
- name: Free some spaces
run: |
echo "Available storage:"
df -h
echo
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /hostedtoolcache/CodeQL
sudo rm -rf $AGENT_TOOLSDIRECTORY
sudo docker image prune --all --force
echo "Available storage:"
df -h
echo
- uses: actions/checkout@v5
- uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v9.2.2
- uses: docker/setup-buildx-action@v3
- name: Download AMD64 artifacts
uses: actions/download-artifact@v6
with:
name: docker-image-amd64
path: /tmp/amd64/
- name: Reassemble AMD64 image
run: |
cat /tmp/amd64/image-amd64.tar.part.* > /tmp/image-amd64.tar
docker load -i /tmp/image-amd64.tar
rm -rf /tmp/amd64/ /tmp/image-amd64.tar
docker tag latex-devcontainer:amd64 localhost:5000/latex-devcontainer:amd64
docker push localhost:5000/latex-devcontainer:amd64
docker rmi latex-devcontainer:amd64 localhost:5000/latex-devcontainer:amd64
df -h
echo
- name: Download ARM64 artifacts
uses: actions/download-artifact@v6
with:
name: docker-image-arm64
path: /tmp/arm64/
- name: Reassemble ARM64 image
run: |
cat /tmp/arm64/image-arm64.tar.part.* > /tmp/image-arm64.tar
docker load -i /tmp/image-arm64.tar
rm -rf /tmp/arm64/ /tmp/image-arm64.tar
docker tag latex-devcontainer:arm64 localhost:5000/latex-devcontainer:arm64
docker push localhost:5000/latex-devcontainer:arm64
docker rmi latex-devcontainer:arm64 localhost:5000/latex-devcontainer:arm64
df -h
echo
- name: Create merged manifest
run: |
docker manifest create --insecure localhost:5000/latex-devcontainer:latest \
--amend localhost:5000/latex-devcontainer:amd64 \
--amend localhost:5000/latex-devcontainer:arm64
docker manifest push localhost:5000/latex-devcontainer:latest
docker manifest inspect localhost:5000/latex-devcontainer:latest
- name: Login to ${{ env.REGISTRY }} with skopeo
run: |
echo "Attempting docker login to: ${{ env.REGISTRY }}"
skopeo login -u "${{ github.actor }}" -p "${{ secrets.GITHUB_TOKEN }}" ${{ env.REGISTRY }}
- name: Push to ${{ env.REGISTRY }}
run: |
for tag in $(docker buildx bake --print | jq -r ".target.latest.tags[]"); do
skopeo copy --multi-arch all --src-tls-verify=false docker://localhost:5000/latex-devcontainer:latest "docker://${tag}"
done