Skip to content

Commit

Permalink
Testing final workflow changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nguy8tri committed Sep 17, 2024
1 parent dbf359c commit 8a0c8e4
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 36 deletions.
51 changes: 15 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ on:
push:
branches: [ "refractor" ]
pull_request:
branches: [ "master" ]
branches: ["master"]
types:
- opened
- synchronize
- reopened

jobs:
build:
Expand Down Expand Up @@ -61,43 +65,18 @@ jobs:
run: make doxygen_generate
- name: Install rsync
run: apt install -y rsync
- name: Set target-folder
id: set-folder
run: |
if [ "${{ github.ref_name }}" = "main" ]; then
echo "TARGET_FOLDER=/"
else
echo "TARGET_FOLDER=${github.ref_name}/"
fi
shell: bash
- name: Upload Pages Artifact
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: documentation
folder: build/documentation/
target-folder: ${{ github.ref_name }}/

# documentation-upload:
# needs: documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# ref: documentation
# - name: Build with Jekyll
# uses: actions/jekyll-build-pages@v1
# with:
# verbose: true
# - name: Upload Pages Artifact
# uses: actions/upload-pages-artifact@v3

# documentation-deploy:
# needs: documentation-upload

# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# permissions:
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source

# # Deploy to the github-pages environment
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}

# # Specify runner + deployment step
# runs-on: ubuntu-latest
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4
target-folder: ${{ steps.set-folder.outputs.TARGET_FOLDER }}/
31 changes: 31 additions & 0 deletions .github/workflows/close-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Cleanup PR

on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: documentation
- name: Delete coverage/documentation for ${{ github.head_ref }} from documentation branch
run: |
folder_to_delete="${{ github.head_ref }}"
echo "Deleting folder: $folder_to_delete from documentation"
rm -rf "$folder_to_delete"
git rm -r "$folder_to_delete" || true
- name: Configure Git for Pushing Deletion change
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: PUshing Deletion Change
run: |
pr = ${{ github.event.pull_request.number }}
git commit -m "Remove folder ${{ github.head_ref }} from documentation branch after PR ${pr} was closed"
git push origin ${{ github.head_ref }}

0 comments on commit 8a0c8e4

Please sign in to comment.