Skip to content

Commit

Permalink
Merge pull request #79 from jhudsl/cansavvy/buggs
Browse files Browse the repository at this point in the history
Update the GitHub Actions!
  • Loading branch information
cansavvy authored Aug 21, 2024
2 parents 22194ff + eb55539 commit ceaa501
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Candace Savonen Dec 2021
# Updated April 2023
# Updated Aug 2024
name: Pull Request

on:
Expand All @@ -16,6 +16,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

# Use the yaml-env-action action.
- name: Load environment from YAML
Expand All @@ -25,7 +26,7 @@ jobs:

# Delete the branch if this has been run before
- name: Delete branch locally and remotely
run: git push origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete"
run: git push --force origin --delete preview-${{ github.event.pull_request.number }} || echo "No branch to delete"

# Make the branch fresh
- name: Make the branch fresh
Expand All @@ -37,7 +38,7 @@ jobs:
branch_name='preview-${{ github.event.pull_request.number }}'
echo branch doesnt exist
git checkout -b $branch_name || echo branch exists
git push --set-upstream origin $branch_name
git push --force --set-upstream origin $branch_name
shell: bash

outputs:
Expand Down Expand Up @@ -115,12 +116,12 @@ jobs:
- name: Website preview for download
run: zip website-preview.zip docs/* -r

# Commit the rendered website files
- name: Commit rendered website files to preview branch
# Commit the website files
- name: Commit rendered website files
id: commit
run: |
branch_name='preview-${{ github.event.pull_request.number }}'
git diff origin/main -- '*.html' >/dev/null && changes=true || changes=false
git diff origin/main -- docs >/dev/null && changes=true || changes=false
echo "changes=$changes" >> $GITHUB_OUTPUT
git add . --force
git commit -m 'Render preview' || echo "No changes to commit"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/render-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
runs-on: ubuntu-latest
container:
image: ${{needs.yaml-check.outputs.rendering_docker_image}}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit ceaa501

Please sign in to comment.