DEV Community

cedricbuild
cedricbuild

Posted on

2 2

Automating github pages with actions

My Workflow

This workflow publish all files in given folder and publishes to gh-pages or configured branch

checkout https://github.com/cedricbuild/gh-publish-branch

Submission Category:

Deployment, Publishing

Yaml File or Link to Code

on: [push]

jobs:
  publish-directory:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - run: |
          mkdir build
          echo "<html><title> github actions publish ${{ github.run_id }} </title></html>" > build/index.html
      - uses: ./
        with:
          repo_name: ${{ github.repository }}
          branch: gh-pages
          directory: ${{ github.workspace }}/build
          commit_message: "publish directory to branch"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay