Files
upload-pages-artifact/action.yml
T

47 lines
1.3 KiB
YAML
Raw Normal View History

name: "Upload Pages artifact"
description: "A composite action that prepares your static assets to be deployed to GitHub Pages"
2022-05-10 22:02:28 -04:00
inputs:
2022-05-24 11:12:29 -07:00
path:
description: "Path of the directoring containing the static assets."
2022-05-10 22:02:28 -04:00
required: true
default: "_site/"
2022-05-24 11:12:29 -07:00
retention-days:
description: "Duration after which artifact will expire in days."
2022-05-24 11:12:29 -07:00
required: false
default: "1"
2022-05-10 22:02:28 -04:00
runs:
2022-05-24 11:12:29 -07:00
using: composite
steps:
- name: Archive artifact
2022-05-10 22:17:15 -04:00
shell: bash
2022-08-01 06:46:01 -07:00
if: runner.os != 'Windows'
2022-05-24 14:30:41 -07:00
run: |
2022-05-24 11:12:29 -07:00
tar \
--dereference --hard-dereference \
--directory ${{ inputs.path }} \
-cvf ${{ runner.temp }}/artifact.tar \
--exclude=.git \
2022-07-13 11:56:17 -07:00
--exclude=.github \
2022-05-24 11:12:29 -07:00
.
2022-08-01 06:46:01 -07:00
# Massage the paths for Windows only
- name: Archive artifact
shell: bash
if: runner.os == 'Windows'
run: |
tar \
--dereference --hard-dereference \
--directory "${{ inputs.path }}" \
-cvf "${{ runner.temp }}\artifact.tar" \
--exclude=.git \
--exclude=.github \
--force-local \
"."
2022-05-10 22:02:28 -04:00
- name: Upload artifact
uses: actions/upload-artifact@main
with:
2022-05-24 11:12:29 -07:00
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: ${{ inputs.retention-days }}