Skip to content

Commit

Permalink
Updated github actions, fix path issues with image plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
MWDelaney committed Dec 16, 2024
1 parent cfe73a7 commit 4500f22
Show file tree
Hide file tree
Showing 6 changed files with 669 additions and 946 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ runs:

# Upload the public directory as an artifact
- name: 📦 Upload Artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-artifact@v4
with:
name: public
path: public
17 changes: 10 additions & 7 deletions .github/actions/new-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ runs:
using: 'composite'
steps:
# Get the current date and time in both human-readable and machine-readable formats
# Human-readable should be "Thursday, 1 January 1970 00:00"
- name: Get the date and time
shell: bash
id: get_date
run: |
echo "human_date=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_OUTPUT
echo "human_date=$(date +'%A, %d %B %Y %H:%M')" >> $GITHUB_OUTPUT
echo "machine_date=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
# Create a Git tag with the environment name and machine-readable date
Expand All @@ -34,27 +35,29 @@ runs:
custom_tag: "${{ inputs.environment }}-${{ steps.get_date.outputs.machine_date }}"
tag_prefix: ''

# Get the "public" artifact from this workflow
- name: Get artifact
# Get the artifact from the build job
- name: 📥 Get artifact
id: get_artifact
uses: actions/download-artifact@v4
with:
name: public
path: public.tar.gz
path: public

- name: 📦 Zip artifact
run: zip -r public.zip public
shell: bash

# If this is the main branch, create a release named after the github repo slug and the human readable date
- name: 📦 Create release
if: ${{ inputs.environment == 'production' }}
uses: ncipollo/release-action@v1
with:
tag: "${{ steps.tag_version.outputs.new_tag }}"
artifacts: "public.tar.gz"
artifacts: "public.zip"
token: ${{ inputs.github_token }}
makeLatest: true
name: "${{ github.event.repository.name }} ${{ steps.get_date.outputs.human_date }}"
body: |
# ${{ inputs.environment }}
* 📅 ${{ steps.get_date.outputs.human_date }}
${{ steps.tag_version.outputs.changelog }}
1 change: 0 additions & 1 deletion .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ env:
jobs:
build:
# Only run this job if the repository has a GitHub Pages site
if: ${{ github.event.repository.has_pages }}
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/deploy-github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,28 @@ jobs:
# Deploy the site to GitHub Pages
runs-on: ubuntu-latest
steps:
# Get the artifact from the build job
- name: 📥 Get artifact
id: get_artifact
uses: actions/download-artifact@v4
with:
name: public
path: public

#Re-upload artifact in pages-friendly way
- name: 📦 Upload Artifact
uses: actions/upload-pages-artifact@v3
with:
name: public-github-pages
path: public

# Deploy the site to GitHub Pages
- name: 🚀 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
artifact_name: public
artifact_name: public-github-pages

release:
needs: build
Expand Down
Loading

0 comments on commit 4500f22

Please sign in to comment.