Creation of RADAR target TEI specification #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Datalake | |
#site_url: https://username.github.io/repository-name/ | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Étape 1 : Vérification du code source | |
- uses: actions/checkout@v2 | |
# Étape 2 : Configuration de Python | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.x | |
# Étape 3 : Installation des dépendances | |
- run: pip install -r requirements.txt | |
# Étape 4 : Déploiement avec MkDocs | |
- run: mkdocs gh-deploy --force | |
# Étape 5 : Passage à la branche `gh-pages` | |
- run: git checkout gh-pages | |
# Étape 6 : Remplacement des URLs relatives par des URLs absolues | |
- name: Replace relative URLs | |
run: > | |
CI_PAGES_URL="https://$( cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY" ).github.io/$( cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY" )/" && | |
for file in $(find * -name "*.html"); do | |
sed -i "s|<img \([^\\\>]*\)src=\"\([^\:]*\)\"|<img \1\src=\"$CI_PAGES_URL/$(dirname $file)/\2\"|g" $file; | |
sed -i "s|<iframe \([^\\\>]*\)src=\"\([^\:]*\)\"|<iframe \1\src=\"$CI_PAGES_URL/$(dirname $file)/\2\"|g" $file; | |
sed -i "s|<a \([^\\\>]*\)href=\"\([^#][^\:\"]*\)\"|<a \1\href=\"$CI_PAGES_URL/$(dirname $file)/\2\"|g" $file; | |
done | |
# Étape 7 : Commit et push des modifications | |
- run: git config user.email "[email protected]" && git config user.name "Jean-Marc Hasenfratz" && git add . && git commit -m "Relative to absolute urls" && git push origin gh-pages | |
# Étape 8 : Envoi d'un email après le déploiement | |
# - name: Send email notification | |
# uses: dawidd6/action-send-mail@v3 | |
# with: | |
# server_address: smtp.gmail.com | |
# server_port: 587 | |
# username: ${{ secrets.EMAIL_USERNAME }} | |
# password: ${{ secrets.EMAIL_PASSWORD }} | |
# subject: "Déploiement terminé : ${{ github.repository }}" | |
# body: | | |
# Bonjour, | |
# | |
# Le déploiement du site Datalake est terminé avec succès. | |
# | |
# Accédez au site ici : https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/ | |
# | |
# Cordialement, | |
# GitHub Actions | |
# to: "[email protected]" | |
# from: "GitHub Actions <[email protected]>" |