From d5309620db3237d202a8b93256103ba4395676f5 Mon Sep 17 00:00:00 2001 From: Elyan Date: Sun, 13 Oct 2024 15:52:56 +0200 Subject: [PATCH] Add docs build CI --- .gitea/workflows/build.yaml | 50 +++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .gitea/workflows/build.yaml diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 0000000..c41b8f1 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,50 @@ +# Based on https://github.com/riscv/riscv-isa-manual/blob/main/.github/workflows/isa-build.yml +name: Central(Architecture) Docs Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + types: [opened, synchronize] + +env: + DOCKER_IMG: docker-asciidoctor-wavedrom + +jobs: + build: + name: Build Documentation + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set short SHA + run: echo "SHORT_SHA=$(echo ${GITEA_SHA::7})" >> $GITEA_ENV + + - name: Get current date + run: echo "CURRENT_DATE=$(date +'%Y-%m-%d')" >> $GITEA_ENV + + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ vars.CONTAINER_REGISTRY_URL }} + username: ${{ vars.CONTAINER_REGISTRY_USERNAME }} + password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} + + - name: Pull Container + id: pull_container_image + run: docker pull ${{ vars.CONTAINER_REGISTRY_URL }}/${{ gitea.repository_owner }}/${{ env.DOCKER_IMG }}:latest + + - name: Build Files + id: build_files + if: steps.pull_container_image.outcome == 'success' + run: make -j$(nproc) + + - name: Upload central-execution-engine-spec.pdf + if: steps.build_files.outcome == 'success' + uses: actions/upload-artifact@v4 + with: + name: central-execution-engine-spec-${{ env.SHORT_SHA }}.pdf + path: ${{ gitea.workspace }}/build/central-execution-engine-spec.pdf + retention-days: 7