Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: output working directory #1086

Open
3 tasks done
Falco20019 opened this issue Aug 14, 2024 · 0 comments
Open
3 tasks done

proposal: output working directory #1086

Falco20019 opened this issue Aug 14, 2024 · 0 comments
Assignees
Labels

Comments

@Falco20019
Copy link

Checklist

  • I am using the latest version of this action.
  • I have read the latest README and followed the instructions.
  • I have read the latest GitHub Actions official documentation and learned the basic spec and concepts.

Describe your proposal

It would be great to export the working directory as action output to be used in follow-up actions. Right now, I use the following to update a part of the specification and publish it using actions/deploy-pages:

name: Deploy - TechSpec

on:
  workflow_call:
    inputs:
      artifact-name:
        type: string
        required: true
        description: "Name of the artifact that contains the files to deploy."
      tech-spec-folder:
        type: string
        required: true
        description: "The name of the subfolder to use (defined by the version)."
    secrets:
      ACTION_PAT:
        required: true

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
  group: techspec_${{ github.repository }}
  cancel-in-progress: false

jobs:
  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    
    runs-on: ubuntu-latest
    
    steps:
      - name: Download package
        uses: actions/download-artifact@v4
        with:
            name: ${{ inputs.artifact-name }}
            path: artifact
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v4
        with:
          personal_token: ${{ secrets.ACTION_PAT }}
          publish_dir: artifact
          destination_dir: ${{ inputs.tech-spec-folder }}
      - name: Setup Pages
        uses: actions/configure-pages@v5
        with:
          enablement: true
          token: ${{ secrets.ACTION_PAT }}
      - name: Checkout gh-pages
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.ACTION_PAT }}
          ref: gh-pages
          path: _site
      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4
        with:
          token: ${{ secrets.ACTION_PAT }}

Describe the solution you'd like

If peaceiris/actions-gh-pages would export the working directory, it would not be necessry to checkout the gh-pages branch again, since it's already on the runner. Instead, I could just pass the path to actions/upload-pages-artifact directly.

Describe alternatives you've considered

No response

Additional context

It seems, that this action is assuming that the legacy model of using branches is configured for triggering the publish. But since GitHub marked it as legacy, we would prefer to use the GitHub Actions workflow proposed by them instead in combination with having

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants