I don't know how to solve this issue, people online had pointed out that it may have something to do with baseurl:, typing the name of my site there or leaving it empty doesn't seem to be working. People had also pointed out changing theme on the config.yml to "remote_theme", that also didn't work
Please have a look at my code, any ideas? I wish I had more information in regards to why this happens
Repo: https://github.com/SimonXTest/simonxtest.github.io
You'll know it's the right repo because there should be a broken.txt in the directory
Remote website image:
Local website image:
Try to add to your github workflow the bundle-install statement.
The rubygems (for the theme) are missing.
You don't have the _layout folder in your source control, so you need to get it from the gems.
In your GitHub Workflow / Action you should do sth. like this.
jobs:
bundler:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v2
- name: Setup Ruby
uses: ruby/setup-ruby#v1
with:
ruby-version: 3.0
bundler-cache: true
- name: Installing dependencies
run: bundle install
Related
During workflow execution, I produce several artifacts but after a successful build I no longer need them and I want to clean that up as I only need them temporarily.
- name: Make artifact available to use
uses: actions/upload-artifact#v2
with:
name: setup
path: setup.yml
As a part of a different job I need artifacts so I also have
- name: Download yaml file
uses: actions/download-artifact#v2
with:
name: setup
How can I add a step in the workflow (in my case, the last step) that's gonna remove these artifacts that were produced during runtime?
There are delete artifact actions on the marketplace that could help you with that.
Example with this one:
steps:
- uses: actions/checkout#v3
- run: echo hello > world.txt
- name: Make artifact available to use
uses: actions/upload-artifact#v2
with:
name: setup
path: world.txt
# delete-artifact
- uses: geekyeggo/delete-artifact#v1
with:
name: setup
I made a workflow run example here if you want to have a look.
As part of a python API for accessing GitHub. One of the examples provides a tool for waxy repository artifact build-up. Demo: https://youtu.be/lS37uCKELNM
I am using this tutorial to publish my Blazor WebAssemply site to Github pages. When I run the action I get
/home/runner/work/learning-blazor/learning-blazor/Learning_Blazor.csproj : error MSB4236: The SDK 'Microsoft.NET.Sdk.BlazorWebAssembly' specified could not be found.
All other tutorials lead to the same result. Here is my main.yml:
name: Deploy to GitHub Pages
# Run workflow on every push to the master branch
on:
push:
branches: [ main ]
jobs:
deploy-to-github-pages:
# use ubuntu-latest image to run steps on
runs-on: ubuntu-latest
steps:
# uses GitHub's checkout action to checkout code form the master branch
- uses: actions/checkout#v2.4.2
# sets up .NET Core SDK 3.1
- name: Setup .NET Core SDK
uses: actions/setup-dotnet#v2.1.0
with:
dotnet-version: 3.1
# publishes Blazor project to the release-folder
- name: Publish .NET Core Project
run: dotnet publish Learning_Blazor.csproj -c Release -o release --nologo
- name: Deploy GitHub Pages site
uses: actions/deploy-pages#v1.0.10
with:
token: github.token
Can someone suggest a fix?
I was faced with the same issue, and it was caused by the dotnet-version of my app actually being .NET 7 so I changed that line to dotnet-version: 7.0.x. You can do the same for .NET 5 and 6 I imagine.
I've built a github action to push my nuget package to github registry based on github docs. When it runs it compiles well but on push it runs to the following error.
Pushing XXXXX.1.0.0.nupkg to 'https://nuget.pkg.github.com/MYACCOUNT'
PUT https://nuget.pkg.github.com/MYACCOUNT/ warn : invalid repo host
'nuget.pkg.github.com', only github (github.com) repositories allowed BadRequest
https://nuget.pkg.github.com/MYACCOUNT/ 42ms error: Response status code does not indicate success: 400 (Bad Request).
Error message is not too verbose.
Api-key is registered in Personal access tokens. It has write/read:packages and full control of private repository permission.
What do I miss here?
Related yaml is the following:
name: publish to nuget
on:
push:
branches:
- master
jobs:
publish:
name: build, pack & publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- name: Pack
run: dotnet pack XXX.csproj -c Release
- name: Prep packages
run: dotnet nuget add source --username MYACOUNTNAME --password *** --store-password-in-clear-text --name github "https://nuget.pkg.github.com/MYACCOUNTNAME/index.json"
- name: Publish to GitHub packages
run: dotnet nuget push bin/Release/*.nupkg --api-key *** --source "github"
For those who are concerned. After hours of struggle I found the problem.
I had to modify my .csproj file.
<RepositoryUrl>https://github.com/MYACCOUNTNAME/EXACT_REPOSITORY_NAME</RepositoryUrl>
My issues was that root url was https://nuget.pkg.github.com instead of github.com alone.
What a dumb error message...
I have 2 java projects on GitHub, the first project produces a java library and the second project uses it.
The first project is build via first job in yaml file and it installs the library in /home/runner/.m2/repository/ successfully
Then when the second project is build via the second job in the same yaml file , it fails with error
Failed to execute goal on project <>: Could not resolve dependencies
for project Could not find artifact <>:jar:1.0-
SNAPSHOT -> [Help 1]
In my second project, I have included the dependency to load this library jar(produced by first project) from the repository.
MY understanding is that my second project should load the jar library from the /home/runner/.m2/repository/ but its not loading it.
Any help is appreciated.
Also can we access /home/runner/.m2/repository/ to check if it contains the library jar.
./project_account_library/account_library => Contains maven project
./project_account_service/account_service => Contains maven project
./.github/workflows/build.yml
Here is the yml file
name: Build account service
on:
push:
branches: [main]
env:
IMAGE_NAME: accountservice
jobs:
build_dependency:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout#v2
- uses: actions/setup-java#v2
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Build Dependency
run: |
cd ./project_account_library/account_library
mvn clean install
build_accountservice:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout#v2
- uses: actions/setup-java#v2
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
- name: Build Account Service
run: |
cd ./project_account_service/account_service
mvn clean install
First Step
[INFO] Installing /home/runner/work/<>/<>/target/account_
library_1.0-SNAPSHOT.jar to
/home/runner/.m2/repository/com/<>/<>/account_library/1.0-
SNAPSHOT/account_library-1.0-SNAPSHOT.jar
Second Step
Error: Failed to execute goal on project <>: Could not resolve
dependencies for project <>: Could not find artifact com.<>.
<>:account_library:jar:1.0-SNAPSHOT -> [Help 1]
Thanks Frennky
I now used only 1 job and below is my new .yml file
- name: Build Account Service
run: |
cd ./project_account_library/account_library
mvn clean install
cd ../../project_account_service/account_service
mvn clean install
First directory is successfully built but it fails to cd to ../../project_account_service/account_service and fails to build with below error
/home/runner/work/_temp/ea229141-b0c3-455d-82f0-12ff588d420a.sh: line 12: cd ../../project_account_service/account_service: No such file or directory
The reason you're missing dependencies on your second job is because those 2 jobs, by default, run in parallel and they do so on 2 different runners. From docs:
Each job will run inside its own virtual machine runner, or inside a
container...
There's few ways you can go around this. I can suggest one quick and easy, and another that would probably be a way to go, but require slightly more effort.
Easy way out of this is to put all steps in a single job.
Better way would be to make use of Github Package repository, where
you could push your lib/dependencies and then resolve them for your
service.
For more details on Github Package repository you can check docs.
Update:
Ok, I've reread your new error and I think I understand the issue.
If I got it right your dir structure is as follows:
repo
project_account_library
account_library
project_account_service
account_service
Each run step actually starts at root of you repo. You can use working-directory like so:
# ...
- name: Build Dependency
run: mvn clean install
working-directory: ./project_account_library/account_library
# ...
- name: Build Account Service
run: mvn clean install
working-directory: ./project_account_service/account_service
I am trying to run my github runner as root for self hosted linux servers. Can anyone point me to easy solution that I can implement quickly in following code:
name: Test
on: push
jobs:
Test1:
runs-on: selfhosted-linux # This should run on this self hosted runner only
steps:
- uses: actions/checkout#v2
At this point I cannot ssh into the selfhoste linux but can access it only via code in the workflow folder
and I would like to run the checkout as root rather then non root user.
You need to set the environment variable RUNNER_ALLOW_RUNASROOT before you run config.sh to set up the runner. e.g.
RUNNER_ALLOW_RUNASROOT=1 ./config.sh --token asdlkjfasdlkj