central-arch-doc/.gitea/workflows/build.yaml

58 lines
1.7 KiB
YAML
Raw Normal View History

2024-10-13 13:52:56 +00:00
# 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
- 'devops/**'
2024-10-13 13:52:56 +00:00
pull_request:
branches:
- master
- 'devops/**'
2024-10-13 13:52:56 +00:00
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: Display $GITEA_ENV
run: echo "\$GITEA_ENV=$GITEA_ENV"
2024-10-13 13:52:56 +00:00
- 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
2024-10-13 13:52:56 +00:00
- name: Upload central-execution-engine-spec.pdf
if: steps.build_files.outcome == 'success'
uses: christopherhx/gitea-upload-artifact@v4
2024-10-13 13:52:56 +00:00
with:
name: central-execution-engine-spec-${{ env.SHORT_SHA }}.pdf
path: ${{ gitea.workspace }}/build/central-execution-engine-spec.pdf
retention-days: 7