feat: texliveonfly #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
paths: | |
- .github/workflows/build.yml | |
- shell/** | |
- .dockerignore | |
- Dockerfile | |
pull_request: | |
paths: | |
- .github/workflows/build.yml | |
- shell/** | |
- .dockerignore | |
- Dockerfile | |
jobs: | |
verify: | |
if: github.event_name == 'pull_request' | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_BUILDKIT: "1" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build final image | |
run: docker build . | |
publish: | |
# needs: [verify] | |
if: github.event_name == 'push' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
username: qmcgaw | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Set variables | |
id: vars | |
run: | | |
BRANCH=${GITHUB_REF#refs/heads/} | |
TAG=${GITHUB_REF#refs/tags/} | |
echo ::set-output name=commit::$(git rev-parse --short HEAD) | |
echo ::set-output name=build_date::$(date -u +%Y-%m-%dT%H:%M:%SZ) | |
if [ "$TAG" != "$GITHUB_REF" ]; then | |
echo ::set-output name=version::$TAG | |
echo ::set-output name=platforms::linux/amd64,linux/arm64 | |
elif [ "$BRANCH" = "master" ]; then | |
echo ::set-output name=version::latest | |
echo ::set-output name=platforms::linux/amd64,linux/arm64 | |
else | |
echo ::set-output name=version::$BRANCH | |
echo ::set-output name=platforms::linux/amd64,linux/arm64 | |
fi | |
- name: Build and push scheme-basic image | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: ${{ steps.vars.outputs.platforms }} | |
build-args: | | |
BUILD_DATE=${{ steps.vars.outputs.build_date }} | |
COMMIT=${{ steps.vars.outputs.commit }} | |
VERSION=${{ steps.vars.outputs.version }} | |
SCHEME=scheme-basic | |
tags: qmcgaw/latexdevcontainer:${{ steps.vars.outputs.version }} | |
push: true | |
- name: Build and push scheme-full image | |
uses: docker/build-push-action@v4 | |
with: | |
platforms: ${{ steps.vars.outputs.platforms }} | |
build-args: | | |
BUILD_DATE=${{ steps.vars.outputs.build_date }} | |
COMMIT=${{ steps.vars.outputs.commit }} | |
VERSION=${{ steps.vars.outputs.version }} | |
SCHEME=scheme-full | |
tags: qmcgaw/latexdevcontainer:${{ steps.vars.outputs.version }}-full | |
push: true |