Skip to content

Merge pull request #71 from famedly/chore/update-github-actions-shas #70

Merge pull request #71 from famedly/chore/update-github-actions-shas

Merge pull request #71 from famedly/chore/update-github-actions-shas #70

Workflow file for this run

name: Publish to GitHub Pages

Check failure on line 1 in .github/workflows/github-pages.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/github-pages.yml

Invalid workflow file

(Line: 37, Col: 19): Unrecognized named-value: 'artifact'. Located at position 1 within expression: artifact.id
on:
workflow_call:
inputs:
artifact_name:
description: "Name of the uploaded artifacts directory"
type: string
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Clean repository
run: rm -rf ./*
- name: Download Artifacts
uses: actions/download-artifact@484a0b528fb4d7bd804637ccb632e47a0e638317
with:
name: ${{inputs.artifact_name}}
- name: Publish to GitHub Pages
working-directory: .
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout --orphan gh-pages
git add .
git commit -m "Publish to GitHub Pages"
git push --force origin gh-pages
- name: Delete Artifact
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
script: |
const artifacts = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
});
const artifact = artifacts.data.artifacts.find((artifact) => artifact.name === "${{inputs.artifact_name}}");
await github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: ${{artifact.id}},
});