diff --git a/.github/workflows/build-sldes.yaml b/.github/workflows/build-sldes.yaml new file mode 100644 index 0000000..224e8e3 --- /dev/null +++ b/.github/workflows/build-sldes.yaml @@ -0,0 +1,51 @@ +name: Build and Deploy Slides + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v2 + + - name: Set up Docker + run: | + echo "Docker is already available on GitHub-hosted runners." + + - name: Run Marp to generate HTML slides + run: | + cd talk + docker run --rm --init \ + -v ${{ github.workspace }}:/home/marp/app \ + -e LANG=${{ secrets.LANG }} \ + -p 8080:8080 -p 37717:37717 \ + marpteam/marp-cli:v3.2.0 --theme ngi-theme.css --html . + + - name: Commit and Push HTML slides to gh-pages + run: | + # Install Git if it's not already available + sudo apt-get update + sudo apt-get install -y git + + # Configure git user + git config --global user.name "GitHub Action" + git config --global user.email "action@github.com" + + # Create gh-pages branch if it doesn't exist + git checkout -b gh-pages + + # Remove old slides and add new ones + rm -rf ./* + cp -r /home/marp/app/*.html . + + # Add, commit, and push the changes + git add . + git commit -m "Update slides" + git push -f origin gh-pages + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/talk/.github/workflows/build-sldes.yaml b/talk/.github/workflows/build-sldes.yaml index 947d78f..906992f 100644 --- a/talk/.github/workflows/build-sldes.yaml +++ b/talk/.github/workflows/build-sldes.yaml @@ -3,7 +3,7 @@ name: Build and Deploy Slides on: push: branches: - - main # Triggers on pushes to the main branch + - main jobs: build: