diff --git a/.github/workflows/deploy-site.yml b/.github/workflows/deploy-site.yml index 4f1dd2461f..b7ef9f1d84 100644 --- a/.github/workflows/deploy-site.yml +++ b/.github/workflows/deploy-site.yml @@ -18,7 +18,12 @@ # name: Deploy Site -on: pull_request +on: push +# push: +# branches: +# - 'master' +# schedule: +# - cron: '13 * * * *' jobs: deploy: @@ -26,17 +31,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + ref: master - name: Install Dependencies - shell: bash run: | sudo apt-get update sudo apt-get install -y doxygen tzdata python -m pip install --upgrade pip pip install -r requirements.txt - - name: Setup project - shell: bash + - name: Setup Project run: | cd .. git clone https://github.com/apache/mynewt-documentation @@ -44,7 +49,29 @@ jobs: git clone https://github.com/apache/mynewt-nimble git clone https://github.com/apache/mynewt-newt git clone https://github.com/apache/mynewt-newtmgr - cd mynewt-site - ./build.py - ./deploy.sh - git diff --name-only + + - name: Build Site + run: ./build.py + + - name: Fetch Deployment Branch + run: | + git fetch origin asf-site:asf-site + + - name: Deploy Site + run: ./deploy.sh build + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: asf-site update + base: asf-site + branch: site-update + title: "Deploy site" + body: | + Deploy site: + - Builds the static site from `master` branch + - Pushes the changes to `asf-site` + - Auto-generated by [create-pull-request][1] + + [1]: https://github.com/peter-evans/create-pull-request