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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create public directory | |
run: mkdir -p ./public # Crée le dossier public s'il n'existe pas | |
- name: Inject secret into secret.js | |
run: echo "window.PROTECTED_PASSWORD = '${{ secrets.PROTECTED_PASSWORD }}';" > ./public/secret.js | |
- name: Copy HTML and other assets to public | |
run: cp -r ./index.html ./public/ # Copie le fichier HTML dans le dossier public | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public |