Skip to content

Preview Deploy

Preview Deploy #2

name: Preview Deploy
on:
workflow_run:
workflows:
- "Preview Build"
types:
- completed
permissions:
pull-requests: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
with:
run-id: '${{ github.event.workflow_run.id }}'
- name: Parse meta.json
run: |
echo "PR_NUMBER=$(jq -r .pr_number meta.json)" >> $GITHUB_ENV
echo "PR_BRANCH=$(jq -r .pr_branch meta.json)" >> $GITHUB_ENV
- name: Url slug variable
run: |
echo "URL_SLUG=${{ env.PR_NUMBER }}-${{ env.PR_BRANCH }}" >> $GITHUB_ENV
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: ${{ secrets.DEPLOY_KEY }}

Check failure on line 34 in .github/workflows/preview_deploy.yml

View workflow run for this annotation

GitHub Actions / Preview Deploy

Invalid workflow file

The workflow is not valid. .github/workflows/preview_deploy.yml (Line: 34, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DEPLOY_KEY .github/workflows/preview_deploy.yml (Line: 47, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DEPLOY_KEY
with:
folder: web_demo
repository-name: egui-pr-preview/pr
branch: 'main'
clean: true
target-folder: ${{ env.URL_SLUG }}
ssh-key: ${{ secrets.DEPLOY_KEY }}
commit-message: "Update preview for PR ${{ env.URL_SLUG }}"
force: false
- name: Comment PR
uses: thollander/actions-comment-pull-request@v2
if: ${{ secrets.DEPLOY_KEY }}
with:
message: |
Preview available at https://egui-pr-preview.github.io/pr/${{ env.URL_SLUG }}