Remove TL_YEAR argument #70
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: Docker | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Run tests | |
run: | | |
make test | |
push: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Prepare configuration | |
run: | | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# Strip "v" prefix from tag name | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
# Use Docker `latest` tag convention | |
[ "$VERSION" == "main" ] && VERSION=latest | |
IMAGE_NAME=${{ github.actor }}/latex | |
echo VERSION=$VERSION | |
echo "version=${VERSION}" >> $GITHUB_ENV | |
echo IMAGE_NAME=IMAGE_NAME | |
echo "image_name=${IMAGE_NAME}" >> $GITHUB_ENV | |
- name: Run tests | |
run: | | |
make test | |
- name: Build minimal | |
run: | | |
make minimal | |
docker tag kjarosh/latex:latest-minimal ${{ env.image_name }}:${{ env.version }}-minimal | |
docker tag kjarosh/latex:latest-minimal ghcr.io/${{ env.image_name }}:${{ env.version }}-minimal | |
- name: Build basic | |
run: | | |
make basic | |
docker tag kjarosh/latex:latest-basic ${{ env.image_name }}:${{ env.version }}-basic | |
docker tag kjarosh/latex:latest-basic ghcr.io/${{ env.image_name }}:${{ env.version }}-basic | |
- name: Build small | |
run: | | |
make small | |
docker tag kjarosh/latex:latest-small ${{ env.image_name }}:${{ env.version }}-small | |
docker tag kjarosh/latex:latest-small ghcr.io/${{ env.image_name }}:${{ env.version }}-small | |
- name: Build medium | |
run: | | |
make medium | |
docker tag kjarosh/latex:latest-medium ${{ env.image_name }}:${{ env.version }}-medium | |
docker tag kjarosh/latex:latest-medium ghcr.io/${{ env.image_name }}:${{ env.version }}-medium | |
- name: Build full | |
run: | | |
make full | |
docker tag kjarosh/latex:latest-full ${{ env.image_name }}:${{ env.version }}-full | |
docker tag kjarosh/latex:latest-full ghcr.io/${{ env.image_name }}:${{ env.version }}-full | |
docker tag kjarosh/latex:latest-full ${{ env.image_name }}:${{ env.version }} | |
docker tag kjarosh/latex:latest-full ghcr.io/${{ env.image_name }}:${{ env.version }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Push images | |
run: | | |
docker push ${{ env.image_name }}:${{ env.version }}-minimal | |
docker push ${{ env.image_name }}:${{ env.version }}-basic | |
docker push ${{ env.image_name }}:${{ env.version }}-small | |
docker push ${{ env.image_name }}:${{ env.version }}-medium | |
docker push ${{ env.image_name }}:${{ env.version }}-full | |
docker push ${{ env.image_name }}:${{ env.version }} | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }}-minimal | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }}-basic | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }}-small | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }}-medium | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }}-full | |
docker push ghcr.io/${{ env.image_name }}:${{ env.version }} |