latex-packages/.gitea/workflows/build.yaml

82 lines
2.4 KiB
YAML
Raw Permalink Normal View History

2023-10-18 09:22:08 +02:00
name: Build LaTeX packages
on: [push]
2021-10-24 10:35:53 +02:00
2023-10-18 09:22:08 +02:00
jobs:
build:
runs-on: latex-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
2023-10-18 11:06:35 +02:00
with:
submodules: recursive
2023-10-18 11:12:09 +02:00
fetch-depth: 0 # We need all history to correctly parse tag names
2023-10-18 11:11:01 +02:00
fetch-tags: true
2023-10-18 09:22:08 +02:00
- name: Setup git credentials and committer
run: .ci/configure_git.sh
2023-10-18 09:55:28 +02:00
env:
2023-10-18 11:31:12 +02:00
DEPLOY_SSH_KEY: ${{ secrets.deploy_ssh_key }}
2023-10-18 09:22:08 +02:00
- name: Clone build repository
uses: actions/checkout@v4
with:
2023-10-18 11:19:33 +02:00
repository: latex/latex-packages-build
2023-10-19 02:21:13 +02:00
path: build/packages
2023-10-18 10:11:47 +02:00
ref: master
2023-10-18 09:22:08 +02:00
- name: Checkout correct branch in build repository
run: |
.ci/setup_build_repo_branch.sh
2023-10-18 10:26:11 +02:00
env:
REF_NAME: ${{ github.ref_name }}
2023-10-19 02:21:13 +02:00
- name: Build packages incrementally
run: make
2023-10-19 02:47:45 +02:00
- name: Push packages to build repo
2023-10-18 09:22:08 +02:00
run: |
2023-10-19 02:21:13 +02:00
.ci/deploy_to_build_repo.sh
2023-10-18 11:04:38 +02:00
env:
REF_NAME: ${{ github.ref_name }}
2023-10-19 12:56:19 +02:00
- name: Clean up git files from build repo
2023-10-19 02:23:39 +02:00
if: github.ref == 'refs/heads/master'
2023-10-19 12:56:19 +02:00
run: rm -rf build/packages/.git
- name: Save built packages to cache
if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v3
with:
path: build/packages/
key: ${{ github.ref }}-packages
pages:
runs-on: latex-latest
2023-10-19 13:13:23 +02:00
needs: build
2023-10-19 12:56:19 +02:00
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load package cache
uses: actions/cache/restore@v3
with:
path: build/packages/
key: ${{ github.ref }}-packages
- name: Load compilation cache
uses: actions/cache/restore@v3
with:
path: .compile
key: ${{ github.ref }}-doc
- name: Compile documentation
run: make doc
2023-10-19 10:08:20 +02:00
env:
2023-10-19 10:42:01 +02:00
TEXINPUTS: '${{ github.workspace }}/build/packages//:'
2023-10-19 02:21:13 +02:00
- name: Prepage pages
run: |
cd build
rm -rf packages/.git # Don't deploy the git files
zip -r latex-packages.zip packages/ -x '*.git*'
2023-10-19 02:23:39 +02:00
zip -r latex-packages-doc.zip doc/
2023-10-19 02:21:13 +02:00
- name: Deploy to pages
2023-10-18 09:22:08 +02:00
uses: actions/pages@v1
with:
directory: build/
2023-10-19 12:56:19 +02:00
- name: Upload compilation cache
uses: actions/cache/save@v3
with:
path: .compile
key: ${{ github.ref }}-doc