Skip to content

Docker Image CI

Docker Image CI #26

Workflow file for this run

name: Docker Image CI
on:
push:
tags: ["*"]
workflow_dispatch:
schedule: [cron: '0 0 1 * *']
jobs:
docker-base-build:
runs-on: ubuntu-latest
strategy:
matrix:
variant: ["debian:bullseye-slim", "debian:bookworm-slim", "ubuntu:focal", "ubuntu:jammy"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tags
run: |
echo "Setting tags..."
if [ "${{ matrix.variant }}" = "debian:bookworm-slim" ]; then
echo "LATEST_TAG=${{ github.actor }}/vscode-latex:latest" >> $GITHUB_ENV
echo "Added latest tag"
fi
echo "TAG_NAME=$(echo "${{ matrix.variant }}" | awk -F: '{print $NF}' | cut -d "-" -f1)" >> $GITHUB_ENV
docker system prune --all --force
- name: Build and push
uses: docker/build-push-action@v3.3.0
with:
build-args: VARIANT=${{ matrix.variant }}
push: true
sbom: true
context: build
file: build/Dockerfile.base
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: |
${{ github.actor }}/vscode-latex:${{ env.TAG_NAME }}-${{ github.sha }}
${{ github.actor }}/vscode-latex:${{ env.TAG_NAME }}
${{ env.LATEST_TAG }}
docker-lang-build:
runs-on: ubuntu-latest
needs: docker-base-build
strategy:
matrix:
variant: ["debian:bookworm-slim", "ubuntu:jammy"]
lang: [all, arabic, chinese, cjk, cyrillic, czechslovak, english, european, french, german, greek, italian, japanese, korean, other, polish, portuguese, spanish]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tags
run: |
echo "Setting tags..."
echo "TAG_NAME=$(echo "${{ matrix.variant }}" | awk -F: '{print $NF}' | cut -d "-" -f1)" >> $GITHUB_ENV
docker system prune --all --force
- name: Build and push
uses: docker/build-push-action@v3.3.0
with:
build-args: |
VARIANT=${{ env.TAG_NAME }}
LANG=${{ matrix.lang }}
push: true
sbom: true
context: build
file: build/Dockerfile.language
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: ${{ github.actor }}/vscode-latex:${{ env.TAG_NAME }}-lang-${{ matrix.lang }}
docker-full-build:
runs-on: ubuntu-latest
needs: docker-base-build
strategy:
matrix:
variant: ["debian:bookworm-slim", "ubuntu:jammy"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set tags
run: |
echo "Setting tags..."
echo "TAG_NAME=$(echo "${{ matrix.variant }}" | awk -F: '{print $NF}' | cut -d "-" -f1)" >> $GITHUB_ENV
docker system prune --all --force
- name: Build and push
uses: docker/build-push-action@v3.3.0
with:
build-args: VARIANT=${{ env.TAG_NAME }}
push: true
sbom: true
context: build
file: build/Dockerfile.full
platforms: linux/amd64,linux/arm64
tags: ${{ github.actor }}/vscode-latex:${{ env.TAG_NAME }}-full