Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

deploy file(s), not folder#997

nschloe started this conversation inIdeas
Jan 10, 2022· 2 comments· 3 replies
Discussion options

I have multiple cases where I'd like to deploy a file or files, not a folder; for example, aREADME.md. The following fails:

      -name:Deploy 🚀uses:JamesIves/github-pages-deploy-action@4.2.1with:repository-name:foobar/docbranch:mainfolder:README.md

with

rsync: change_dir "/home/runner/work/foobar/foobar/README.md" failed: Not a directory (20)

It seems that the restriction tofolders could be lifted to allow for allpaths, be it folders or files.

You must be logged in to vote

Replies: 2 comments 3 replies

Comment options

As it stands pushing a single file in this regard isn't supported. Supporting such a thing would be considered a major version bump so there's a few things to consider.

  • If this option did exist, would bothfolder andfiles be merged into a single parameter? Perhapspaths?
  • Wouldpaths accept a single path, or multiple?
  • If multiple, what happens when there's a file name conflict in the deployment directory that is created?
  • What if one of the items in the path list is found, but another is not. Does the action fully fail or partially deploy what it could find?

I'm curious to learn more about your use case for this, and if there's a general consensus or not if this is something that multiple people want.

In the interim you can pushREADME.md into abuild folder by running a script before the deployment job runs, and then simply deploy from the folder that you create within the workflow.

name:Build and Deployon:[push]jobs:build-and-deploy:runs-on:ubuntu-lateststeps:      -name:Checkout 🛎️uses:actions/checkout@v2      -name:Generate deployment folderrun:|          mkdir build          mv README.md build/README.md      -name:Deploy 🚀uses:JamesIves/github-pages-deploy-action@v4with:branch:mainrepository-name:foobar/docfolder:build# Deploy the newly created "build" folder.
You must be logged in to vote
1 reply
@nschloe
Comment options

In the interim you can push README.md into a build folder by running a script before the deployment job runs, and then simply deploy from the folder that you create within the workflow.

That's what I'm doing right now. Thanks for the concise reply!

Comment options

You can control what gets deployed just with .gitignore. If you want to have some files in your repo but not your deployment, then you could copy an alternative .gitignore over the top of the normal .gitignore as a step before the deploy action. That's what I do - my normal .gitignore ignores dist/, and my deployment .gitignore ignores src/.

You must be logged in to vote
2 replies
@kapilkashyap
Comment options

@curiousdannii Can you please provide an example script of how you are doing this.

Thanks

@curiousdannii
Comment options

You literally justcp the second .gitignore file into the root folder.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
4 participants
@nschloe@curiousdannii@kapilkashyap@JamesIves

[8]ページ先頭

©2009-2025 Movatter.jp