Coder Social home page Coder Social logo

jeffreytse / jekyll-deploy-action Goto Github PK

View Code? Open in Web Editor NEW
320.0 2.0 43.0 94 KB

🪂 A Github Action to deploy the Jekyll site conveniently for GitHub Pages.

License: MIT License

Dockerfile 4.03% Ruby 16.49% Shell 74.98% HTML 4.50%
jekyll site actionscript deploy gh-pages ci gihub-actions actions awesome recommend

jekyll-deploy-action's Introduction


jekyll-theme-yat →~ jekyll

🪂 A GitHub Action to deploy the Jekyll site conveniently for GitHub Pages.


JEKYLL DEPLOY ACTION

Jekyll action for deployment.

Tests Release Version License: MIT Donate (Liberapay) Donate (Patreon) Donate (Ko-fi)

Built with ❤︎ by jeffreytse and contributors

✨ Story

As we known, GitHub Pages runs in safe mode and a set of allow-listed plugins. To use the gem in GitHub Pages, you need to build locally or use CI (e.g. travis, github workflow) and deploy to your gh-pages branch.

Therefore, if you want to make Jekyll site run as if it were local, such as let the custom plugins work properly, this action can be very useful for you, beacause it's really convenient to build and deploy the Jekyll site to Github Pages.

📚 Usage

At First, you should add a github workflow file (e.g. .github/workflows/build-jekyll.yml) in your repository's master branch as below:

name: Build and Deploy to Github Pages

on:
  push:
    branches:
      - master  # Here source code branch is `master`, it could be other branch

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # Use GitHub Actions' cache to cache dependencies on servers
      - uses: actions/cache@v4
        with:
          path: |
            .asdf/**
            vendor/bundle
          key: ${{ runner.os }}-cache-${{ hashFiles('**/cache.key') }}
          restore-keys: |
            ${{ runner.os }}-cache-

      # Use GitHub Deploy Action to build and deploy to Github
      # For latest version: `jeffreytse/jekyll-deploy-action@master`
      - uses: jeffreytse/[email protected]
        with:
          provider: 'github'         # Default is github
          token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
          ssh_private_key: ''        # It's your SSH private key (SSH approach)
          repository: ''             # Default is current repository
          branch: 'gh-pages'         # Default is gh-pages for github provider
          jekyll_src: './'           # Default is root directory
          jekyll_cfg: '_config.yml'  # Default is _config.yml
          jekyll_baseurl: ''         # Default is according to _config.yml
          ruby_ver: ''               # Default is 3.2.0 version
          bundler_ver: ''            # Default is compatible bundler version (~>2.5.0)
          cname: ''                  # Default is to not use a cname
          actor: ''                  # Default is the GITHUB_ACTOR
          pre_build_commands: ''     # Installing additional dependencies (Arch Linux)

Now this action supports the following providers:

  • github: To publish the site to GitHub.
  • test: To check if build passes on pull requests without publishing the site.
  • ssh: To publish the site into any server which supports SSH protocol.
  • ...

To schedule a workflow, you can use the POSIX cron syntax in your workflow file. The shortest interval you can run scheduled workflows is once every 5 minutes. For example, this workflow is triggered every hour.

on:
  schedule:
    - cron:  '0 * * * *'

At the start of each workflow run, GitHub automatically creates a unique GITHUB_TOKEN secret to use in your workflow. You can use the GITHUB_TOKEN to authenticate in a workflow run. You can use the GITHUB_TOKEN by using the standard syntax for referencing secrets: ${{ secrets.GITHUB_TOKEN }}. For more information, you can see here.

If you need a token that requires permissions that aren't available in the GITHUB_TOKEN, you can create a Personal Access Token (PAT), and set it as a secret in your repository for this action to push to the gh-pages branch:

  • Create a Personal Access Token with custom permissions and copy the value.
  • Go to your repository’s Settings and then switch to the Secrets tab.
  • Create a token named GH_TOKEN (important) using the value copied.

In the end, go to your repository’s Settings and scroll down to the GitHub Pages section, choose the gh-pages branch as your GitHub Pages source.

Additionally, if you don't have the gh-pages branch, you can create it as below:

git checkout --orphan gh-pages
git rm -rf .
git commit --allow-empty -m "initial commit"
git push origin gh-pages

💡 Tip: The gh-pages branch is only for the site static files and the master branch is for source code.

✨ FAQ

If you use jekyll-last-modified-at plugin, you can configure the checkout action to fetch all commit history so that plugin could use the last Git commit date to determine a page's last modified date.

- uses: actions/checkout@v3
  with:
    # The checkout action doesn't provide a way to get all commit history for a single branch
    # So we use the magic number 2147483647 here which means infinite depth for git fetch
    # See https://github.com/actions/checkout/issues/520, https://stackoverflow.com/a/6802238
    fetch-depth: 2147483647

If your site building needs some specific environments, here are some recipes for you:

# NodeJS
pre_build_commands: pacman -S --noconfirm nodejs npm

# Python
pre_build_commands: pacman -S --noconfirm python

# Gem RMagick
pre_build_commands: pacman -S --noconfirm imagemagick

# Jekyll-Picture-Tag
pre_build_commands: pacman -S --noconfirm libvips lcms2 openjpeg2 libpng libwebp libheif imagemagick openslide libjxl poppler-glib

If you prefer to deploy your site in SSH approach for better stability, you can also creates a unique SSH_PRIVATE_KEY secret to use in your workflow:

ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

Note: SSH approach has higher priority than HTTP approach when you provide both at the same time.

🌱 Credits

  • Jekyll - A blog-aware static site generator in Ruby.
  • actions/checkout - Action for checking out a repo.
  • actions/cache - Cache dependencies and build outputs in GitHub Actions.

✍️ Contributing

Issues and Pull Requests are greatly appreciated. If you've never contributed to an open source project before I'm more than happy to walk you through how to create a pull request.

You can start by opening an issue describing the problem that you're looking to resolve and we'll go from there.

🌈 License

This software is licensed under the MIT license © JeffreyTse.

jekyll-deploy-action's People

Contributors

ambersun1234 avatar datapolitical avatar dependabot[bot] avatar floating-cat avatar jeffreytse avatar jodygarnett avatar lmarti avatar thiefmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jekyll-deploy-action's Issues

Support to deploy site via SSH protocol

As deploying by SSH protocol has better stability (e.g. prevent from curl: (55) Failed sending HTTP POST request mentioned in #64), we need to provide a new option named ssh_private_key to configure custom SSH private key, and this option has higher priority than the token option, which means this action will try to push via SSH protocol rather than HTTP protocol.

Support to check github repository name

In case a user gives a wrong repository (e.g. https://github.com/jeffreytse/jekyll-theme-yat), we should check the value of repository parameter, it should match the pattern <author>/<repos> (e.g. jeffreytse/jekyll-theme-yat).

Could not find JS runtime

Hi,

I'm getting this error while building

Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

As far as I've read on the internet it says that we need to install node js to rectify this issue. Do we have this dependency covered in this docker build? Also, if yes can you please take a look at the possible solution to this issue?

Here is the build link : https://github.com/rohitjain00/rohitjain00.github.io/actions/runs/4040838762/jobs/6946852704

add an optional choice to build using the source file

I already use this action and it's pretty good to solve my problem for using other plugins.

but I found I can't build my site using my local theme, which means I need to specific a remote-theme and I can't configure it locally.

Is there any possible to build my site and using my own theme?

My English is not very well, hope you can understand what I mean. ^-^

Document that the vendor directory must be excluded

This line https://github.com/jeffreytse/jekyll-deploy-action/blob/master/entrypoint.sh#L22 causes Bundler to install gems to the vendor subdirectory of the working directory so gems can be cached. However, it also means Jekyll will attempt to include files from gems in the site, potentially leading to errors like https://hjerpbakk.com/blog/2020/05/25/your-site-could-not-be-built for a site that built just fine outside of this action.

Documenting that the vendor directory needs adding to the site's exclude list would be helpful for avoiding and diagnosing this kind of problem.

failed: "It's conflicted to deploy on same branch master"

deployment failed: "It's conflicted to deploy on same branch master"

no good reason for me to deploy to a different branch, actually makes my job a lot more complicated when the build command changes only a few files in the _site directory

Over the years, I've have websites using a variety of frameworks from Hugo to Jekyll and a variety of others, deploying to the same branch as I'm building from has been a problem only this time.

Suggestion for project

In order to port from official github-page gem to jeykll + this action, I need to use this deploy file:

name: deploy

on:
  push:
    branches:
      - master
  workflow_dispatch:
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/[email protected]
      - name: Set GitHub variables
        run: |
          echo "repository: $GITHUB_REPOSITORY" >> _config.yml
          #echo "url: https://$(echo $GITHUB_REPOSITORY | cut -d '/' -f1).github.io" >> _config.yml
          #echo "baseurl: /$(basename $GITHUB_REPOSITORY)" >> _config.yml
      - uses: actions/cache@v2
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - uses: jeffreytse/[email protected]
        with:
          provider: 'github'
          token: ${{ secrets.GITHUB_TOKEN }}
          pre_build_commands: export JEKYLL_GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}

Basically I need an extra deps "jekyll-github-metadata" so it can auto set site.url + baseurl, otherwise i need to set it manually (see the commented out lines)

But you don't seem to "export" JEKYLL_GITHUB_TOKEN with the token so I need an extra step, would be good if you can add that in your entrypoint.sh...

I still need to set repository: maunally though (but if I use official github-page gem it auto set), but that's minor issue

Do I need this project structure?

Sorry if I use an issue for a question: I created the .github/workflows/build-jekyll.yml in my jekyll project, I pushed it to github, I created gh-pages branch. Workflow run correctly. But it doesn't work: after workflow run gh-pages branch is empty. This is my project structure:
Schermata 2022-07-27 alle 11 23 23

Do I need to inglobe my project in jekyll-deploy-action project structure? If yes do I need to mantain your Gemfile actions?

Is it "TOKEN" or "GH_TOKEN"?

The code and my failed workflow seems suggesting me to use "TOKEN", while the doc says "GH_TOKEN".

I think it should be "TOKEN" per the code?

`with.repository` parameter is unable to access external repository: "The requested URL returned error: 403"

Use Case

I am attempting to use jekyll-deploy-actions for the following use case:

  • I have a private repository that I use for taking notes and writing blog posts using Jekyll
  • I want to publish using GitHub pages, though don't want to pay for the premium subscription (required for publishing from a private repository)
  • Instead, I'd like to use this action and the with.repository argument to push the pages bundle to a public repository that can then publish via GitHub pages for free

Workflow Definition

Here is the definition of my GitHub workflow (from the private repository), which is configured according to the README:

name: Deploy Github Pages

on:
    push:
        branches:
            - main
        paths:
            - .github/workflows/build-jekyll.yml
            - Website/**

jobs:
    build-and-deploy:
        runs-on: ubuntu-latest
        steps:
            - uses: actions/checkout@v2

            - uses: jeffreytse/jekyll-deploy-action@master
              with:
                  branch: main
                  provider: github
                  repository: cwboden/website
                  token: ${{ secrets.GITHUB_TOKEN }}

When this Workflow runs, it completes the build / bundling process successfully, but fails when attempting to push to my public repo:

remote: Permission to cwboden/website.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/cwboden/website.git/': The requested URL returned error: 403

I initially thought this was a problem with the secrets.GITHUB_TOKEN, so I also added a PAT to the repository under the secret GH_TOKEN (as outlined in the README):
image

However, I end up with the same error 😢 I'm curious if the with.repository parameter is only supported by SSH authentication?

Other Troubleshooting Attempts

I also tried a few other things, such as replacing the with.token parameter with $GH_TOKEN (though then the build step cannot complete), using a Legacy GitHub PAT rather than the granular ones, and by removing the authorization headers, according to this Stack Overflow post.

None of these have helped, though I can update this section as I continue troubleshooting the problem. My next step will be to take a look at how GH_TOKEN is used within the plugin source code. Perhaps I'm missing something there.

I cannot get custom plugins and running workflows at the same time

Hi,
I'm playing with this Github action. It deploys my blog, but the somehow I can't get it to deploy the state of the gh-pages branch.

My repository with the blog is here: https://github.com/list4c/list4c.github.io/tree/gh-pages

In pictures:

image

This is how the figures look when my publishing source is main (set in Repository - > Settings -> Pages)

If I change it to gh-pages, then the website content gets updated and the timeago plugin works, showing yesterday - see here:

image

So I was thinking that I should change it to gh-pages, but when I do it, the workflows stop running. So that must be the wrong option. What could I be doing wrong?

So I would like to: have workflows running as defined + have the plugin correctly working on the deployed site, on a continuous basis. I guess something might be set up incorrectly with my deployments.

I'll greatly appreciate your expertise on this matter

Copy CNAME file from source branch

I'm using a custom domain for my github page. This requires a CNAME file, but since the target branch always gets replaced with the jekyll output, this file gets lost even if it is present in the source branch, breaking the site.

Successful build but failed deployment

Hi, thanks for your contribution on this.

There have been several failed deployments before.

image

This is the latest deployment failure action.

image

and see details:

Run actions/deploy-pages@v1
  with:
    token: ***
    timeout: 600000
    error_count: 10
    reporting_interval: 1000
Actor: github-pages[bot]
Action ID: 1996884744
Artifact URL: [pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/workflows/1996884744/artifacts?api-version=6.0-preview](https://pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/workflows/1996884744/artifacts?api-version=6.0-preview)
{"count":1,"value":[{"containerId":9501682,"size":593920,"signedContent":null,"fileContainerResourceUrl":"[pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/resources/Containers/9501682](https://pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/resources/Containers/9501682)","type":"actions_storage","name":"github-pages","url":"[pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/1/runs/128/artifacts?artifactName=github-pages](https://pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/1/runs/128/artifacts?artifactName=github-pages)","expiresOn":"2022-06-15T05:51:40.6585233Z","items":null}]}
Creating deployment with payload:
{
	"artifact_url": "[pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/1/runs/128/artifacts?artifactName=github-pages&%24expand=SignedContent](https://pipelines.actions.githubusercontent.com/gwZqGkltb8yHXjOVG6ovxf7Mit7vk8tNDy5Tb8PEAWcL4TyfVE/_apis/pipelines/1/runs/128/artifacts?artifactName=github-pages&%24expand=SignedContent)",
	"pages_build_version": "c255ac576eee6ee4876c6cb7b47c1b947d3c65b4",
	"oidc_token": "***"
}
Failed to create deployment for c255ac576eee6ee4876c6cb7b47c1b947d3c65b4.
{"message":"Deployment request failed for c255ac576eee6ee4876c6cb7b47c1b947d3c65b4 due to in progress deployment. Please cancel a5304e0fa906a915f321bd3318fd877d6eeb098a first or wait for it to complete.","documentation_url":"[docs.github.com/rest/reference/repos#create-a-github-pages-deployment](https://docs.github.com/rest/reference/repos#create-a-github-pages-deployment)"}
Error: Error: Request failed with status code 400
Error: Error: Request failed with status code 400
Sending telemetry for run id 1996884744

Then I tried to use the latest bulid-jekyll.yml and still the same error.

This is my repo.

Regards

Q: Do I need to `bundle install` locally anymore?

Hello, I am new to this. Everything is working now. I had some issues where it fails to build, so I did some research and it turns out that I need to delete Gemfile.lock in the main branch. The error message was this:

There was an error while trying to write to `/srv/jekyll/Gemfile.lock`. It is
likely that you need to grant write permissions for that path.
Error: Process completed with exit code 23.

I don't have any issue, but just to ask a question.
I'm wondering if I need to do bundle install locally anymore because it builds for me every time. Thank you.

fatal: unsafe repository ('/github/workspace' is owned by someone else)

Hi, I'm using the (modified version of) YAT Jekyll theme along with this jekyll-deploy-action. Everything works really well for several months, but several days ago, when I push to the GitHub repo, I occasionally receive run failures from GitHub Action.

Here's part of the GitHub Action log:

... (omitted)
* [Ok] Set up job
* [Ok] Build jeffreytse/[email protected]
* [Ok] Run actions/checkout@v2
* [Ok] Run actions/cache@v2
* [Err!] Run jeffreytse/[email protected]

... (omitted)
fatal: unsafe repository ('/github/workspace' is owned by someone else)
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
Fetching https://github.com/eventmachine/eventmachine.git
... (omitted)

I've tried several times, but this bug/error only occurs occasionally. Here are some key GitHub Action logs related to this problem:

When this problem starts to show up, I didn't change anything about the github/workflow, any suggestions or possible reason of such error?

My GitHub Repo's address is here, if needed

Error when trying to run libvips for Jekyll-Picture-Tag

/github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory. (LoadError)
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory

1_build_and_deploy.txt

Github Actions not caching _site

I'm running into an odd issue where every time my site deploys it has to re-generate all of the webp image files, because it can't find them in the destination directory (despite being in the same folder with the originals). The code runs fine locally, but that's because the _site folder is still there. But with this plugin that _site data disappears after it's pushed.

Edit: I should add that I had to fork the action and edit it to run with ubuntu-latest and bash in order to get the thing to run the webp plugin. If there's a way to update it to support the plugin using the current setup. https://github.com/datapolitical/jekyll-deploy-action

So I'm just sort of trying to figure out how to make the two work together correctly, and any thoughts you might have would be very welcome.

https://github.com/sverrirs/jekyll-webp/blob/master/lib/jekyll-webp/webpGenerator.rb

What is the base path of jekyll_cfg value ?

Hi,
I am wondering what is the base path of jekyll_cfg value, is it the repository's root or jekyll_src value.
For example, given a repository like:

root
│   README.md
└───github-pages
│   │   _config.yml
│   │   index.md
│   └───assets
│       │   ...

The jekyll_src being github-pages, does jekyll_cfg should be _config.yml (assuming it will be built as <jekyll_src>/<jekyll_cfg>) or github-pages/_config.yml (assuming it will be built regardless jekyll_src) ?

Cache bundle gems not working

Since getting OS name from /etc/os-release and saving to the bundle's folder is always failed, this causes caching bundle gems not working.

No such file or directory - gsl-config

Hi again :)

My site enabled lsi which leverages gem "classifier-reborn" and gem "gsl". It works fine by me locally in Mac. It also works fine with travis-ci.com (I am trying to migrate the deployment from travis-ci to github actions). It is not working with this action though.

Since gsl requires installing libgsl0-dev in ubuntu, so I added this before the sample yml. It is installed successfully. However, I am still running into the following issue:

Run jeffreytse/[email protected] ...
Starting the Jekyll Deploy Action
Initial comptible bundler
Successfully installed bundler-2.2.7
1 gem installed
Starting bundle install
...
Fetching gsl 2.1.0.3
Installing gsl 2.1.0.3 with native extensions
...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/github/workspace/vendor/bundle/ruby/2.7.0/gems/gsl-2.1.0.3/ext/gsl_native
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.7.0 -r
./siteconf20210127-20-1bvc9kd.rb extconf.rb
*** ERROR: missing required library to compile this module: No such file or
directory - gsl-config
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/usr/local/bin/$(RUBY_BASE_NAME)
	--with-gsl-version

extconf failed, exit code 1

Gem files will remain installed in
/github/workspace/vendor/bundle/ruby/2.7.0/gems/gsl-2.1.0.3 for inspection.
Results logged to
/github/workspace/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux-musl/2.7.0/gsl-2.1.0.3/gem_make.out

An error occurred while installing gsl (2.1.0.3), and Bundler cannot continue.
Make sure that `gem install gsl -v '2.1.0.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  gsl

I noticed there is imagemagick added to the action's Dockerfile, which I am also trying to install via apt-get to support a gallery plugin. Here's the exact lines I added to the yml:

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - name: install packages
        run: |
          sudo apt-get update -y -qq
          sudo apt-get install -y libgsl0-dev libmagick++-dev
          which gsl-config

      - uses: actions/checkout@v2
 
      # the remaining is the same as the sample

I am wondering if this can be solved via building into Dockerfile? It is a bit hard to debug because the trial and error nature of testing the workflow 🤕

Fatal error in pushing to gh-pages branch does not cause action to also fail

I've been having some issues with getting the plugin configured for my repository and been working through debugging. Recently I've gotten the following error:

fatal: could not read Password for 'https://***@github.com': No such device or address but this did not cause the github action to fail, instead it reported a success. It appears that there may be a bug on errors that occur later in the build process that are not getting reported correctly.

Below is the final part of the log, the actual Jekyll build succeeds but the part of pushing to the branch fails for some still unknown reason(not the purpose of this issue).

Bundled gems are installed into `./vendor/bundle`
Post-install message from dnsruby:
Installing dnsruby...
  For issues and source code: https://github.com/alexdalitz/dnsruby
  For general discussion (please tell us how you use dnsruby): https://groups.google.com/forum/#!forum/dnsruby
Post-install message from sass:

Ruby Sass has reached end-of-life and should no longer be used.

* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
  primary implementation: https://sass-lang.com/install

* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
  sassc gem: https://github.com/sass/sassc-ruby#readme

* For more details, please refer to the Sass blog:
  https://sass-lang.com/blog/posts/7828841

Post-install message from html-pipeline:
-------------------------------------------------
Thank you for installing html-pipeline!
You must bundle Filter gem dependencies.
See html-pipeline README.md for more details.
https://github.com/jch/html-pipeline#dependencies
-------------------------------------------------
Post-install message from rubyzip:
RubyZip 3.0 is coming!
**********************

The public API of some Rubyzip classes has been modernized to use named
parameters for optional arguments. Please check your usage of the
following classes:
  * `Zip::File`
  * `Zip::Entry`
  * `Zip::InputStream`
  * `Zip::OutputStream`

Please ensure that your Gemfiles and .gemspecs are suitably restrictive
to avoid an unexpected breakage when 3.0 is released (e.g. ~> 2.3.0).
See https://github.com/rubyzip/rubyzip for details. The Changelog also
lists other enhancements and bugfixes that have been implemented since
version 2.3.0.
Starting jekyll build
Configuration file: _config.yml
            Source: /github/workspace
       Destination: /github/workspace/build
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 2.638 seconds.
 Auto-regeneration: disabled. Use --watch to enable.
Deploying to BU-Spark/bu-spark.github.io on branch gh-pages
Deploying to https://***@github.com/BU-Spark/bu-spark.github.io.git
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /github/workspace/build/.git/
[master (root-commit) c0efc9e] jekyll build from Action a82ab4027f3f3c1c4c7ac745461b24f4a0dcfddd
 16 files changed, 511 insertions(+)
 create mode 100644 .nojekyll
 create mode 100644 404.html
 create mode 100644 LICENSE
 create mode 100644 README.md
 create mode 100644 about/index.html
 create mode 100644 assets/css/just-the-docs-dark.css
 create mode 100644 assets/css/just-the-docs-default.css
 create mode 100644 assets/css/just-the-docs-light.css
 create mode 100644 assets/images/just-the-docs.png
 create mode 100644 assets/images/search.svg
 create mode 100644 assets/js/just-the-docs.js
 create mode 100644 assets/js/search-data.json
 create mode 100644 assets/js/vendor/lunr.min.js
 create mode 100644 feed.xml
 create mode 100644 index.html
 create mode 100644 jekyll/update/2021/10/08/welcome-to-jekyll.html
fatal: could not read Password for 'https://***@github.com': No such device or address

Relevant Action run: https://github.com/BU-Spark/bu-spark.github.io/runs/3883985529?check_suite_focus=true

Thanks!

How to test the action?

I'd like a testing action that runs on PRs before merging, which builds but doesn't deploy. Is this possible?

Sudden step failure without any change

Starting yesterday, this step for my project began failing on installing nokogiri:

An error occurred while installing nokogiri (1.10.10), and Bundler cannot
continue.

In Gemfile:
  rails was resolved to 6.1.7.2, which depends on
    actioncable was resolved to 6.1.7.2, which depends on
      actionpack was resolved to 6.1.7.2, which depends on
        actionview was resolved to 6.1.7.2, which depends on
          rails-dom-testing was resolved to 2.0.3, which depends on
            nokogiri

This happened without any change to my repo, so I'm assuming there was an upstream change that caused the failure? Did I miss a deprecation or mandatory upgrade?

Clarification on 'repos

Your setup instructions asks:

  • Create a Personal Token with repos permissions and copy the value.

What specifically is needed?

  • repo
    • repo:status
    • repo_deployment
    • public_repo
    • repo:invite
    • security_events

bundler: failed to load command: jekyll

Hello,

Using master, I'm getting this error:

2021-03-29T00:01:00.2545035Z Bundle complete! 13 Gemfile dependencies, 46 gems now installed.
2021-03-29T00:01:00.2545821Z Bundled gems are installed into `./vendor/bundle`
2021-03-29T00:01:00.2845110Z Starting jekyll build
2021-03-29T00:01:00.9374042Z bundler: failed to load command: jekyll (/github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll)
2021-03-29T00:01:00.9379509Z /github/workspace/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs/runtimes.rb:58:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
2021-03-29T00:01:00.9381625Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs.rb:5:in `<module:ExecJS>'
2021-03-29T00:01:00.9382903Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/execjs-2.7.0/lib/execjs.rb:4:in `<top (required)>'
2021-03-29T00:01:00.9384170Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/uglifier-4.2.0/lib/uglifier.rb:5:in `require'
2021-03-29T00:01:00.9385467Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/uglifier-4.2.0/lib/uglifier.rb:5:in `<top (required)>'
2021-03-29T00:01:00.9386913Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-minifier-0.1.10/lib/jekyll-minifier.rb:1:in `require'
2021-03-29T00:01:00.9388516Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-minifier-0.1.10/lib/jekyll-minifier.rb:1:in `<top (required)>'
2021-03-29T00:01:00.9389971Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:66:in `require'
2021-03-29T00:01:00.9391194Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:66:in `block (2 levels) in require'
2021-03-29T00:01:00.9392342Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `each'
2021-03-29T00:01:00.9393627Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:61:in `block in require'
2021-03-29T00:01:00.9394750Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `each'
2021-03-29T00:01:00.9395854Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/runtime.rb:50:in `require'
2021-03-29T00:01:00.9396922Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler.rb:173:in `require'
2021-03-29T00:01:00.9398206Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/lib/jekyll/plugin_manager.rb:53:in `require_from_bundler'
2021-03-29T00:01:00.9399556Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/gems/jekyll-4.2.0/exe/jekyll:11:in `<top (required)>'
2021-03-29T00:01:00.9400650Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll:23:in `load'
2021-03-29T00:01:00.9401665Z 	from /github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll:23:in `<top (required)>'
2021-03-29T00:01:00.9402707Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `load'
2021-03-29T00:01:00.9403805Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:63:in `kernel_load'
2021-03-29T00:01:00.9405131Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli/exec.rb:28:in `run'
2021-03-29T00:01:00.9406176Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli.rb:494:in `exec'
2021-03-29T00:01:00.9407305Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
2021-03-29T00:01:00.9408617Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
2021-03-29T00:01:00.9409893Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
2021-03-29T00:01:00.9411044Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli.rb:30:in `dispatch'
2021-03-29T00:01:00.9412175Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
2021-03-29T00:01:00.9413279Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/cli.rb:24:in `start'
2021-03-29T00:01:00.9414338Z 	from /usr/local/bundle/gems/bundler-2.2.15/exe/bundle:49:in `block in <top (required)>'
2021-03-29T00:01:00.9415895Z 	from /usr/local/bundle/gems/bundler-2.2.15/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
2021-03-29T00:01:00.9417535Z 	from /usr/local/bundle/gems/bundler-2.2.15/exe/bundle:37:in `<top (required)>'
2021-03-29T00:01:00.9418458Z 	from /usr/local/bundle/bin/bundle:23:in `load'
2021-03-29T00:01:00.9419216Z 	from /usr/local/bundle/bin/bundle:23:in `<main>'

"error processing package elpa-magit" "emacs: not found"

See this run. UBICenter/ubicenter.org#288 caused the break; UBICenter/ubicenter.org#287 was 7 days ago and built fine. I also tried updating to 0.2.1 in UBICenter/ubicenter.org#289, but got the same error.

Install git for emacs
  install/git: Handling install of emacsen flavor emacs
  install/git: Byte-compiling for emacs
  + emacs -batch -q -no-site-file -f batch-byte-compile git.el git-blame.el
  /usr/lib/emacsen-common/packages/install/git: 26: emacs: not found
  /usr/lib/emacsen-common/packages/install/git emacs failed at /usr/lib/emacsen-common/lib.pl line 19, <TSORT> line 7.
  dpkg: error processing package elpa-magit (--configure):
   installed elpa-magit package post-installation script subprocess returned error exit status 2

Looks like this might be relevant. Here's our workflow file.

Error as bundler requires Ruby version >=3.0.0

The last version of bundler (>= 0) to support your Ruby & RubyGems was 2.4.22. Try installing it with gem install bundler -v 2.4.22
bundler requires Ruby version >= 3.0.0. The current ruby version is 2.7.8.225.

Action does not fail on authentication issue

I am facing an issue where when the authentication fails with:
remote: Invalid username or password.

The Action jekyll-deploy-action still passes and my pipeline is green.

I am running version @v0.3.1

/usr/bin/env: ‘ruby2.7’: No such file or directory

When we use actions/cache to cache the gems (i.e. vendor/bundle folder), it would introduce this error /usr/bin/env: ‘ruby2.7’: No such file or directory, because this cache could be cached in a different OS (e.g. Ubuntu).

image

How do I use pre_build_commands?

I want to use the vega-lite diagram library along with a jekyll plugin.
how do I use the pre build commands to run npm install?
I want to install the diagram library use the command:
npm install -g vega-cli vega-lite

[feature] Use group/endgroup

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines support group/endgroup. Why not change every echo "Starting XXX" to group/endgroup?

echo "Starting jekyll build"
  JEKYLL_ENV=production bundle exec jekyll build \
    ${JEKYLL_BASEURL} \
    -c ${JEKYLL_CFG} \
    -d ${WORKING_DIR}/build
echo "::group::Starting jekyll build"
  JEKYLL_ENV=production bundle exec jekyll build \
    ${JEKYLL_BASEURL} \
    -c ${JEKYLL_CFG} \
    -d ${WORKING_DIR}/build
echo ::endgroup::

Unable to Build

Hello there,

I stumbled upon this.

image

The following is my workflow.

name: Build and Deploy to Github Pages

on:
  push:
    branches:
      - master  # Here source code branch is `master`, it could be other branch

jobs:
  build_and_deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      # Use GitHub Actions' cache to cache dependencies on servers
      - uses: actions/cache@v2
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-

      # Use GitHub Deploy Action to build and deploy to Github
      - uses: jeffreytse/[email protected]
        with:
          provider: 'github'
          token: ${{ secrets.TOKEN }}

Any idea why this is happening?

gh-pages branch remains empty after push to master; pages build and deployment not triggered

Hello. If I understand correctly (correct me if I don´t please), if I commit to master I should expect two actions to be triggered, the custom one from the yml file and the pages build and deployment from github itself right? I have created the yml workflow file under .github/workflows/, set up the deployment to be from gh-pages branch but when I commit to master, gh-pages remains empty so I get a 404 when I go to my pages url

This is how the repo pages section is configured:

image

Thanks in advance

"Please set the TOKEN environment variable." when it's set

In UBICenter/ubicenter.org#63 I'm trying to test my deployment using instructions from #5. I've set a token per the instructions here, and also tried regenerating a new PAT to make sure, but I'm still getting the error Please set the TOKEN environment variable.

image

Am I doing something wrong?

Here's the latest check: https://github.com/UBICenter/ubicenter.org/pull/63/checks?check_run_id=2090117003#step:5:10

Run jeffreytse/[email protected]
  with:
    provider: github
    branch: test
    jekyll_src: ./
    jekyll_cfg: _config.yml
    bundler_ver: >=0
/usr/bin/docker run --name e4becc7f4f6ad24da1b18df98d2f857e72_944ae4 --label 5588e4 --workdir /github/workspace --rm -e INPUT_PROVIDER -e INPUT_TOKEN -e INPUT_REPOSITORY -e INPUT_BRANCH -e INPUT_JEKYLL_SRC -e INPUT_JEKYLL_CFG -e INPUT_JEKYLL_BASEURL -e INPUT_BUNDLER_VER -e INPUT_CNAME -e INPUT_ACTOR -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/ubicenter.org/ubicenter.org":"/github/workspace" 5588e4:becc7f4f6ad24da1b18df98d2f857e72
Starting the Jekyll Deploy Action
Please set the TOKEN environment variable.

Bundler failed to load command

bundler: failed to load command: jekyll (/github/workspace/vendor/bundle/ruby/2.7.0/bin/jekyll)
139
/github/workspace/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.0/lib/ffi/library.rb:145:in `block in ffi_lib': Could not open library 'vips.so.42': vips.so.42: cannot open shared object file: No such file or directory. (LoadError)
140
Could not open library 'libvips.so.42': libvips.so.42: cannot open shared object file: No such file or directory

Relative urls broken

relative_url and absolute_url filters are returning weird values for me.

e.g. {{'assets/js/lightbox_custom.js' | absolute_url }} returns https://github.com/pages/ConorSheehan1/assets/js/lightbox_custom.js.
it seems baseurl is somehow https://github.com/pages/ConorSheehan1 when it used to be, and should be https://conorsheehan1.github.io. I'd expect https://conorsheehan1.github.io//assets/js/lightbox_custom.js as the filter output.

I've tried loads of different configs, but my site is completely broken :(
https://github.com/ConorSheehan1/ConorSheehan1.github.io

Any idea how I can fix this?

The deployment occasionally silently fails

It's happened a couple of times for me already: the jeffreytse/[email protected] action runs and it gets marked as successful, but doesn't push the built site to the deployment branch.

Looking at the job logs I see the following:

Deploying to nietaki/nietaki.github.io on branch gh-pages
Deploying to ***github.com/nietaki/nietaki.github.io.git
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /github/workspace/build/.git/
[master (root-commit) b482d39] jekyll build from Action c9750a65641e00149d94784206bb9204a98320d1
 158 files changed, 34502 insertions(+)
 create mode 100644 .nojekyll
 (... many lines here cut"
 create mode 100644 til/index.html
error: RPC failed; curl 55 Send failure: Connection reset by peer
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date

It doesn't happen consistently, but only every once in a while, but makes me unable to trust my CI.

I'm not sure what the error...

error: RPC failed; curl 55 Send failure: Connection reset by peer
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly

...refers to specifically, but regardless, I don't think it should be failing silently.

My workflow is pretty standard, with barely anything modified from the defaults:

name: Build and Deploy to Github Pages

on:
  push:
    branches:
      - master
  schedule:
    - cron: '30 5 * * *'

jobs:
  build_and_deploy:
    # permissions: write-all
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      # Use GitHub Actions' cache to cache dependencies on servers
      - uses: actions/cache@v3
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-

      # Use GitHub Deploy Action to build and deploy to Github
      - uses: jeffreytse/[email protected]
        with:
          provider: 'github'
          token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT)
          repository: ''             # Default is current repository
          branch: 'gh-pages'         # Default is gh-pages for github provider
          jekyll_src: './'           # Default is root directory
          jekyll_cfg: '_config.yml'  # Default is _config.yml
          jekyll_baseurl: ''         # Default is according to _config.yml
          bundler_ver: '>=0'         # Default is latest bundler version
          cname: 'nietaki.com'                  # Default is to not use a cname
          actor: ''                  # Default is the GITHUB_ACTOR
          pre_build_commands: ''     # Installing additional dependencies (Arch Linux)

Let me know if there are any other details I should provide

rm: cannot remove '.git': Directory not empty

For some reason we could not remove the .git directory, this would cause the deploy failed, so we should find all of the process ids which are accessing the directory and kill them firstly.

image

Security concern

It is not safe to push your personal token to a public repo, right? I know this might seem very obvious to you, but some people might not realize this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.