Skip to content

Commit

Permalink
[NO-JIRA][Website] Wipe out the old contents of asf-site branch (#3110)
Browse files Browse the repository at this point in the history
* [NO-JIRA][Website] Wipe out the old contents of asf-site branch

and copy over only the newly generated .html files

Also create a simple .asf.yaml file with `publish`

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Update the commit message to link to its trigger

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Improve the workflow description comment

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

* Use `hugo --destination ...` instead of moving folders later

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>

---------

Signed-off-by: Martin Tzvetanov Grigorov <[email protected]>
  • Loading branch information
martin-g authored Aug 22, 2024
1 parent 197ec30 commit b3743f7
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
# to commit it to your repository.


# Sample workflow for building and deploying a Hugo site to GitHub Pages
name: Deploy Hugo site to Pages
# A Github Actions workflow that builds and copies the website to asf-site branch
name: Deploy website

on:
# Runs on pushes targeting the default branch
Expand Down Expand Up @@ -64,16 +64,26 @@ jobs:
hugo \
--gc \
--minify \
--baseURL "https://avro.apache.org/"
--destination ${{ runner.temp }}/website \
--baseURL "/"
- name: Commit new site
run: |
set -ex
mv doc/public docs/
rsync \
-a \
--delete \
--exclude '/.git/' \
${{ runner.temp }}/website/ \
./
echo "publish:
whoami: asf-site
" > .asf.yaml
touch .nojekyll
git config --global user.email "[email protected]"
git config --global user.name "Github Actions"
git checkout --orphan asf-site-staging
git add .
git commit -m "Update docs"
git add --all
git commit -m "Publish built website triggered by ${{ github.sha }}"
git checkout asf-site
git reset --hard asf-site-staging
git push origin asf-site --force
Expand Down

0 comments on commit b3743f7

Please sign in to comment.