Skip to content

Commit

Permalink
Workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mczyz-antmicro committed Jun 29, 2023
1 parent b452cab commit eedefa6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
13 changes: 10 additions & 3 deletions .github/scripts/update_webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ update_webpage(){
LOC_GITHUB_EVENT_NAME=$2
PR_NUMBER=$3
echo -e "${COLOR_WHITE}========== update_webpage args =========${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}LOC_GITHUB_REF_NAME = ${LOC_GITHUB_REF_NAME}"
echo -e "${COLOR_WHITE}LOC_GITHUB_REF_NAME = ${LOC_GITHUB_REF_NAME}"
echo -e "${COLOR_WHITE}LOC_GITHUB_EVENT_NAME = ${LOC_GITHUB_EVENT_NAME}"
echo -e "${COLOR_WHITE}PR_NUMBER = ${PR_NUMBER}"

Expand All @@ -65,10 +65,17 @@ update_webpage(){
replace_dir ./coverage_dashboard ${PUBLIC_DIR}/${DIR}/coverage_dashboard
replace_dir ./verification_dashboard ${PUBLIC_DIR}/${DIR}/verification_dashboard

make -C .github/scripts/indexgen ROOTDIR=`realpath ./public.old` BUILDDIR=`realpath ./public.new`
pushd .github/scripts/indexgen
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
popd

make -C .github/scripts/indexgen all ROOTDIR=`realpath ./public.old` BUILDDIR=`realpath ./public.new`

echo -e "${COLOR_WHITE}Makefile exit status:$?${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}================= tree =================${COLOR_CLEAR}"
tree ./public.new/
tree -d -L 3 ./public.new/

echo -e "${COLOR_WHITE}Webpage update ${COLOR_GREEN}SUCCEEDED${COLOR_CLEAR}"
echo -e "${COLOR_WHITE}============ update_webpage ============${COLOR_CLEAR}"
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/gh-pages-pr-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ on:
types:
- completed

env:
ROOT_DIR: './'

jobs:
deploy:
name: PR Deploy
Expand All @@ -25,12 +22,12 @@ jobs:
uses: dawidd6/action-download-artifact@v2
with:
name: pr_deployment
path: ${{ env.ROOT_DIR }}
path: ./public.new
run_id: ${{ github.event.workflow_run.id }}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.ROOT_DIR }}
publish_dir: ./public.new
11 changes: 10 additions & 1 deletion .github/workflows/publish-webpage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ jobs:
- name: Setup repository
uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4

- name: Print metadata
run: |
run_information="Repository: ${{ github.repository }} Commit SHA:${{ github.sha }} Workflow: ${{ github.workflow }} Run:${{ github.run_id }}"
Expand All @@ -36,7 +39,13 @@ jobs:
uses: actions/checkout@v3
with:
ref: gh-pages
path: ./public.old
path: ./public.checkout

- name: Preserve only valid items
run: |
mkdir -p ./public.old
cp -r ./public.checkout/doctrees ./public.old/ | true
cp -r ./public.checkout/html ./public.old/ | true
- name: Update webpage
if: github.event_name != 'pull_request'
Expand Down

0 comments on commit eedefa6

Please sign in to comment.