38 lines
1.0 KiB
YAML
38 lines
1.0 KiB
YAML
name: CI
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
deploy:
|
|
env:
|
|
REPO: ${{ github.event.repository.name }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- id: version
|
|
name: Version
|
|
run: |
|
|
if [ "${{ github.ref_type }}" = 'tag' ]; then
|
|
newVersion="${{ github.ref_name }}"
|
|
else
|
|
newVersion=$(git describe --tags --abbrev=0 2>/dev/null || echo 0.0.0).dev
|
|
fi
|
|
echo "version=$newVersion" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build
|
|
run: |
|
|
docker build -t git.arindy.de/arindy/latex-runner:${{ steps.version.outputs.version }} .
|
|
|
|
- name: Push
|
|
if: ${{ github.ref_type == 'tag' }}
|
|
run: |
|
|
echo ${{secrets.PACKAGES_TOKEN}} | docker login --username ${{ secrets.PACKAGES_USER }} --password-stdin git.arindy.de
|
|
docker push git.arindy.de/arindy/latex-runner:${{ steps.version.outputs.version }}
|