Comments (11)
Ooooooh, ok sorry, now I get it.
I think it would be easier if you moved the files before running my action: you can use something like cp -r docs/.vuepress/dist/. . && rm -r docs
Your workflow would look like this:
steps:
(...)
- run: 'cp -r bla bla bla'
- uses: EndBug/add-and-commit@v5
(...)
from add-and-commit.
The Vue docs say to navigate to that directory only because they're creating a new repo and then pushing to a custom URL, which my action doesn't currently support.
This are your options:
- You can use some git commands to create a new repo and push to a custom URL, but at that point it's just easier for you to commit directly by running a couple of commands, instead of using the action. If you wanted to use it anyway, you'd need to use the
cwd
option to make it run on that repo. - You can generate your dist, copy over the files, and then use my action to commit everything
- You can use
gh-pages
(which is what I would do), to directly publish the dist folder to your branch (you can edit the name of the branch it uses)
In any of these three ways, there are no changes needed for the action.
from add-and-commit.
Fine, I will choose the more appropriate option.
Thanks for the fast answers/support anyway!
I am closing the issue 😉
from add-and-commit.
I'm not sure if I understand this correctly: what's the difference between adding docs/.vuepress/dist
and adding .
from that path?
Anyway, have you tried using the cwd
option?
from add-and-commit.
Hi @EndBug,
Thanks for the fast reply 😉
The problem is that when running the action at the repository root will lead the git add
command to push the whole docs/.vuepress/dist
path to the repository root.
Here you can see what I mean:
https://github.com/mojs/mojs.github.io/tree/2077e38b39b6ea845d8b94eadbbd06144c7a135d
- there is a
docs/.vuepress/dist
at root (which is wrong) - only files+folders inside
docs/.vuepress/dist
should be at root (not the whole directory path)
So my repository master
branch should finally look like this:
- api/
- assets/
- tools/
- tutorials/
- 404.html
- README.md
- index.html
- logo.png
I have read the whole docs, but may be I am missing something...
Does the cwd
option change the working directory where the Github Actions run?
If yes, this is exactly what I am searching for.
Let me know 😃
from add-and-commit.
This way you're running the action when your directory has already the right structure
from add-and-commit.
@EndBug Haaaaaa... sounds like a good idea too, I will try that and let you know 😃 , thx!
from add-and-commit.
@EndBug hum.. well, the problem is that using rm -r docs
won't be sufficient because I have other files/folders in the root directory 😄 🤔 , like node_modules
. So I have to manage a "static" list of directory here, not appropriate from my point of view.
In addition a step can't run both
run
anduses
keywords, see https://github.com/mojs/mojs.github.io/actions/runs/335569327.
But I understand that I have to run two "steps" separately for your solution, but it won't work.
from add-and-commit.
Well you should have a .gitignore
that prevents the unwanted directories from being added: you have to think about how you would add those files if you were just using git from the terminal, the action is only supposed to "Add and Commit"
If you set up your project and scripts like you would normally do with git, you'll have no problem using the action.
(I know they can't be used both in the same, I've written the example using two different ones...)
from add-and-commit.
Good point, but the problem is that I need to run the add
action's option with --force
because the docs/.vuepress/dist
folder is ignored in the source
branch, as it is made to contain "build" stuff and shouldn't be versioned... making node_modules
folder pushed when using --force
, which is part of the problem.
That's why the VuePress documentation state to "navigate" into the dist build folder.
from add-and-commit.
Happy to help!
from add-and-commit.
Related Issues (20)
- support pull: true option HOT 1
- How to get push working when another commit was pushed? HOT 3
- `commit_sha` returns the full SHA instead of the 7-character SHA
- Support Disabling\Enabling enforce_admins As Part of Push HOT 5
- Avoid pulling if a new branch was just created HOT 1
- Is there a dry-run input? HOT 1
- suggestion: retry push logic HOT 1
- Pre-Commit script HOT 2
- Warning: There are environment variables missing from this runtime, but would be present on GitHub HOT 4
- Warning: The set-output command is deprecated and will be disabled soon HOT 2
- "add" with array input doesn't seem to work HOT 2
- Error with repository ownership HOT 4
- Error: fatal: detected dubious ownership in repository HOT 1
- It doesn't work for me HOT 5
- Status Check war reseted after Commit HOT 6
- Fetch only one branch for performance issues HOT 4
- Node 20 support HOT 3
- False reporting of Working tree clean. Nothing to commit. HOT 3
- Use on a PR HOT 2
- Error: fatal: Cannot prompt because user interactivity has been disabled. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from add-and-commit.