Skip to content

Remove unused variable #100

Remove unused variable

Remove unused variable #100

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@v4
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@v5
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@v5
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
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create merged manifest
run: |
for tag in $(docker buildx bake --print | jq -r ".target.latest.tags[]"); do
docker manifest create $tag \
--amend localhost:5000/latex-devcontainer:amd64 \
--amend localhost:5000/latex-devcontainer:arm64
docker manifest inspect $tag
docker manifest push $tag
done
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}