Skip to content

Commit

Permalink
Create and upload archive artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
tskarhed committed May 13, 2023
1 parent 8178ff5 commit 0051535
Showing 1 changed file with 34 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/build-pages.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
# This is a basic workflow to help you get started with Actions

name: Build and Publish to Github pages

inputs:
name:
description: "Artifact name"
required: false
default: "github-pages"
path:
description: "Path of the directory containing the static assets."
required: true
default: "_site/"
retention-days:
description: "Duration after which artifact will expire in days."
required: false
default: "1"
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
Expand Down Expand Up @@ -48,3 +60,24 @@ jobs:
run: npm run build:pre-11ty
- name: Build eleventy
run: npm run build:11ty --pathPrefix=scores-ly
- name: Build artifact archive
run: |
chmod -c -R +rX "$INPUT_PATH" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "$INPUT_PATH" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
env:
INPUT_PATH: ${{ inputs.path }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ inputs.name }}
path: ${{ runner.temp }}/artifact.tar
retention-days: ${{ inputs.retention-days }}
if-no-files-found: error

0 comments on commit 0051535

Please sign in to comment.