here are my some of the workflow steps and last one is failing
- name: Install oc
uses: redhat-actions/openshift-tools-installer#v1
with:
oc: 4.10
# https://github.com/redhat-actions/oc-login#readme
- name: Log in to OpenShift
uses: redhat-actions/oc-login#v1
with:
openshift_server_url: ${{ env.OPENSHIFT_SERVER }}
openshift_token: ${{ env.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
namespace: ${{ env.OPENSHIFT_NAMESPACE }}
- name: Deploy new image as rollout
run: oc rollout latest dc/asenion-app
unable to find out any GitHub action in github marketplace to run "oc rollout" or other openshift cli commands
Related
I'm trying to pull a git submodule during my 'push' github action. The submodule is a private repository.
I've created a PAT with read-only access to my repositories. And I've added the contents of that PAT as a secret in the git repo (not the submodule).
This is my github action file:
name: Java CI
on: [ push ]
env:
SUBMODULE_ACCESS: ${{ secrets.SUBMODULE_ACCESS }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v3
- name: Update submodules
run: |
git config --global url."https://${SUBMODULE_ACCESS}:x-oauth-basic#github.com/".insteadOf "https://github.com/"
git submodule update --init --recursive
- name: Set up JDK 19
uses: actions/setup-java#v2
with:
java-version: '19'
distribution: 'adopt'
- name: Cache local .m2
uses: actions/cache#v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**.pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Run lints and test with Maven
run: mvn clean install -Dall
When I run this, I see the following error:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
But that link just mentions PATs, which I think I've set up?
I am creating my first NPM packages and working on automating the publish using GitHub Actions. For each commit, I would like to increase the minor version automatically.
If I use npm version minor on the CLI and trigger the GitHub Action, the deployment is completed successfully.
If I try to run the command npm version minor as part of GitHub Action, the deployment is failing at npm publish step.
Workflow File
name: "publish"
on:
push:
branches:
- main
jobs:
release:
name: publish
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout#v3
- name: git configs
run: |
git config user.name nandy
git config user.email nandy#gmail.com
- name: node
uses: actions/setup-node#v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- run: npm version patch
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
Error Message
I have a very specific use case leveraging github actions
Build and push docker image to a private registry on linode
Login to Linode K8s Environment and do a rollout restart on the affected deployments
Problem is, there are no ready yaml file actions on the Github market place for Linode integration- they have for other providers like AWS, Azure, GKE, etc using Dockerhub
The internet in general does not have these use cases combined.
I am a newbie to Github actions so it will take some time to hack this myself. Any help/pointers will be appreciated.
After some hacking, I was able to come up with this simple workflow that works for me. Credit to this post
name: deployment-deploy
on:
push:
branches:
- somebranch
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
#build and push image
- name: Build, tag, and push image to Private registry
id: build-image
env:
IMAGE_TAG: image_tag
run: |
docker build -t ${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG .
docker login registry.domain.com -u ${{ secrets.REGISTRY_USERNAME }} -p ${{secrets.REGISTRY_PASSWORD}}
docker push ${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG
echo "::set-output name=image::${{secrets.REGISTRY_ENDPOINT}}:$IMAGE_TAG"
- name: Kubernetes set context
uses: Azure/k8s-set-context#v1
with:
method: kubeconfig
kubeconfig: ${{ secrets.KUBE_CONFIG }}
#push
- name: Deploy k8s yaml
id: deploy-k8s-yaml
run: |
# Verify deployment
kubectl rollout restart deployment some_depl
How can I publish Npm Package to custom JFrog artifactory using Github action?
publish:
name: Publish the Packages
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- uses: actions/setup-node#v2
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ env.ARTIFACTORY_URL }}
- name: Publish Packages
run: npm publish
working-directory: ${{ env.CORE_WORKING_DIR }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
The above one is giving 401 error. Is it the right approach to do or we've to use some third party actions?
From what I can find, you'll have to do this in a more manual fashion by setting up the JFrog CLI in GitHub.
First, set up JFrog in GitHub actions: https://github.com/marketplace/actions/setup-jfrog-cli
Then, go to JFrog and find how to install npm packages to artifactory using their CLI: https://jfrog.com/blog/npm-flies-with-jfrog-cli/
- uses: jfrog/setup-jfrog-cli#v2
env:
# JFrog platform url (for example: https://acme.jfrog.io)
JF_URL: ${{ secrets.JF_URL }}
# Basic authentication credentials
JF_USER: ${{ secrets.JF_USER }}
JF_PASSWORD: ${{ secrets.JF_PASSWORD }}
or
# JFrog Platform access token
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
- run: |
jf rt npm-install --build-name=${{ inputs.build_name }} --build-number=${{ inputs.build_number }}
That's roughly how it should work.
I'm trying to get my python project to update on Pypi automatically through a github workflow.
I've never done a github workflow (or any workflow). It doesn't seem to work.
It's this line: uses: action/checkout#main under the build-n-publish part.
It always fails and I get: Unable to resolve action action/checkout#main, repository not found.
and this happens no matter what I put in place of main whether it's v1, v2, master, etc...
I couldn't find anything online explaining it. What should I have in place of main?
for context the .yml file:
name: CI
on:
push:
branches:
- main
jobs:
build-n-publish:
name: build and publish pee to pypi
runs-on: macOS-latest
steps:
- uses: action/checkout#pee
with:
repository: ''
- name: Set up Python 3.6
uses: actions/setup-python#v1
with:
python-version: 3.6
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish#master
with:
password: ${{ secrets.pypi_password }}
repository_url: https://pypi.org/legacy/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish#master
with:
password: ${{ secrets.pypi_password }}.