maxheld83 / ghpages Goto Github PK
View Code? Open in Web Editor NEWDeploy arbitrary static assets through GitHub Actions
Home Page: https://github.com/maxheld83/ghpages
License: MIT License
Deploy arbitrary static assets through GitHub Actions
Home Page: https://github.com/maxheld83/ghpages
License: MIT License
Hi, I use this great action to deploy my website after building the assets with npm scripts.
The fact is that this action also trigger the workflow (as it creates a commit/push on master
), so it re-run the workflow... and crash with this (logical) message, as there's noting new to commit.
#################################################
Changing directory to 'BUILD_DIR' . ...
#################################################
Now deploying to GitHub Pages...
Reinitialized existing Git repository in /github/workspace/.git/
On branch master
nothing to commit, working tree clean
### FAILED deploy: gh-pages 10:37:26Z (601ms)
Maybe, in that specific case, it should be great to return a 78
exit code, indicating a neutral
stop.
Github can choose gh-pages
and master
branch for publishing github pages in non username.github.io
repository.
I want to push master branch on repository that selected master
branch to publish github pages.
but, ghpages
action couldn't choose branch.
Can you update for it?
right now, the testing is kinda informal: you can just go to http://www.maxheld.de/ghpages/, and ideally, you should see the last commit sha there if things worked out.
I'd like to have a more fully programmatic way of testing this action, especially as more people rely on it, but I haven't quite figured out an elegant way to do this.
I'd probably involve talking with the GitHub API somehow, to check that the action (given some boilerplate setup) works as intended.
I am also developing this as part of the R package ghactions where I have good unit/integration testing tooling, and I'm not quite sure how that would work here.
Maybe postpone this to a later date, maybe github comes up with something.
If you're using this action with a documentation built with sphinx, you'll get 404 errors because no .nojekyll
file is present in the generated commit.
Maybe this action should be configurable with a jekyll
boolean input?
currently we're relying on people setting sensible filter actions before, but it'd be nice to avoid infinite loop armageddon out of the box.
Might happen if people deploy to gh-pages
, and that deploy itself (which happens via PAT, not the usual GITHUB_TOKEN
which prevents that sort of thing!) might trigger other builds, and so forth.
In simpler projects there shouldn't be any diff to commit on the >1st round, but if there is random stuff in the build such as the build time or something, this might get ugly.
Does this repo still lives ?
... ideally automatically, otherwise need to expose this as an env arg
Sorry for coming with such a specific problem, but I'm trying to use the script for deploying a mkdocs website.
For some reason, the result is a brand new commit on master that totally overwrites the repo.
Does anyone have an idea of what happens here?
My .yml :
name: Publication
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout on Current Commit
uses: actions/checkout@master
- name: Setup python
uses: actions/setup-python@v1
with:
python-version: '3.x'
architecture: 'x64'
- name: Install requirements
run: python -m pip install -r py-requirements.txt
- name: Build with mkdocs
run: python -m mkdocs build --clean
- name: Say that this is not Jekyll
run: cat > site/.nojekyll
- name: Publish site
uses: maxheld83/[email protected]
env:
BUILD_DIR: "site/"
GH_PAT: ${{ secrets.GH_PAT }}
Full code can be seen on gitlab (not on github since repo is reinitialized with each deploy ;-) :
https://gitlab.com/know-rmandie/know-rmandie.gitlab.io/blob/master/.github/workflows/mkdocs.yml
to fully cover the possibilities for GitHub pages sources, as per the docs, I guess we'd need this to.
(this is an extension of #3)
I'm a little cautious about this one, because deploying to docs/
you might:
docs/
logic)We'd need to be quite careful with the git command as well; currently we can just write to some branch and delete all of its history and be done with it.
So this seems to add a lot of complexity.
Also, I just think docs/
, if used at all, should be used by directly committing to it, not through some CI/CD.
Related to: mislav/hub#1644
Fix is provided in the issue
The Entrypoint.sh script currently has the master
branch hardcoded, but the default github branch is now main
. Suggest setting that as a parameter or updating to use the new default.
Line 29 in e48ff5f
It seems that the command add .
from your script does not work correctly for the root dir in BUILD_DIR
.
Here is the output I get with BUILD_DIR = /.
.
If I change the value, for example, to dist/
everything will work fine.
#################################################
Changing directory to 'BUILD_DIR' /. ...
#################################################
Now deploying to GitHub Pages...
warning: adding embedded git repository: github/workspace
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
hint: If you meant to add a submodule, use:
hint:
hint: git submodule add <url> github/workspace
hint:
hint: If you added this path by mistake, you can remove it from the
hint: index with:
hint:
hint: git rm --cached github/workspace
hint:
hint: See "git help submodule" for more information.
error: open("proc/1/mem"): Permission denied
error: unable to index file proc/1/mem
fatal: adding files failed
Initialized empty Git repository in /.git/
### FAILED GitHub Pages Deploy 17:24:08Z (10.705s)
maybe this can be a "host" aka "js" action?
Doesn't seem like this would really need a docker container.
If you have a CNAME file, it will need to be added before deploy each time, otherwise your custom domain will be reset.
It would be great to have a GH_CNAME
env var.
should be obvious that this just deploys, no building.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.