Skip to content

🐛 Correction build #16

🐛 Correction build

🐛 Correction build #16

Workflow file for this run

name: Generate PDF and Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Pandoc and pdflatex
run: |
sudo apt-get update
sudo apt-get install -y pandoc texlive-latex-base texlive-fonts-recommended texlive-latex-extra jq yq
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.43.1/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
- name: Run script
run: ./generate.sh
- name: Add subtitle
run: |
export SUB_TITLE
SUB_TITLE="$(date '+%d/%m/%Y %H:%M:%S') - $(git describe --tags --abbrev=0)"
yq -i '.subtitle = env(SUB_TITLE)' _config.yml
- name: Copy index.md to gh-pages branch
run: |
git config user.name github-actions
git config user.email [email protected]
git fetch
git checkout gh-pages
cp gh-pages-index.md index.md
git add index.md
git commit -m "Add index.md to gh-pages"
git push origin gh-pages
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: Guide photovoltaïque en format PDF
draft: false
prerelease: false
- name: Upload guide-photovoltaique.pdf
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./guide-photovoltaique.pdf
asset_name: guide-photovoltaique.pdf
asset_content_type: application/pdf