github-actions

How to login to Docker registries using Github Actions

雨燕双飞 提交于 2020-08-22 11:55:41
问题 Im trying to push a docker image to public docker repository using github actions following their documentation but I cant make it work: name: CI on: push: branches: - master jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - uses: actions/docker/login@master with: # Set the secret as an input DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} env: # Set the secret in the env DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}

Get the current pushed tag in Github Actions

会有一股神秘感。 提交于 2020-08-21 05:07:28
问题 Is there a way to access the current tag that has been pushed in a Github Action? In CircleCI you can access this value with the $CIRCLE_TAG variable. My Workflow yaml is being triggered by a tag like so: on: push: tags: - 'v*.*.*' And I want to use that version number as a file path later on in the workflow. I have included my final solution based on the chosen answer as another answer below: https://stackoverflow.com/a/58195087/756514 回答1: As far as I know there is no tag variable. However,

Get the current pushed tag in Github Actions

被刻印的时光 ゝ 提交于 2020-08-21 05:07:01
问题 Is there a way to access the current tag that has been pushed in a Github Action? In CircleCI you can access this value with the $CIRCLE_TAG variable. My Workflow yaml is being triggered by a tag like so: on: push: tags: - 'v*.*.*' And I want to use that version number as a file path later on in the workflow. I have included my final solution based on the chosen answer as another answer below: https://stackoverflow.com/a/58195087/756514 回答1: As far as I know there is no tag variable. However,

How to share/extend/reuse/reference GitHub Workflow?

懵懂的女人 提交于 2020-08-09 19:33:50
问题 I have two workflows. One deploys on push to master to a test environment. The other deploys on release to prod environment. They are 90% identical, code copy&paste. Is there a concept such as extracting part of the duplicate logic and putting it into its own file/partial/fragment? 回答1: At this time, reusing one workflow YAML in another, is not possible. This is (was) discussed in several places: How to reuse a whole workflow? Is it possible to reuse workflow yaml to setup similar workflows?

How to share/extend/reuse/reference GitHub Workflow?

China☆狼群 提交于 2020-08-09 19:33:15
问题 I have two workflows. One deploys on push to master to a test environment. The other deploys on release to prod environment. They are 90% identical, code copy&paste. Is there a concept such as extracting part of the duplicate logic and putting it into its own file/partial/fragment? 回答1: At this time, reusing one workflow YAML in another, is not possible. This is (was) discussed in several places: How to reuse a whole workflow? Is it possible to reuse workflow yaml to setup similar workflows?

How to install private github repository via npm in github actions workflow ci

血红的双手。 提交于 2020-08-05 08:06:47
问题 I am trying to install npm dependencies within a github workflow ci by running npm install . However i get the following error: npm ERR! Error while executing: npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/private-org/private-repo.git npm ERR! npm ERR! Warning: Permanently added the RSA host key for IP address 'removed' to the list of known hosts. npm ERR! git@github.com: Permission denied (publickey). npm ERR! fatal: Could not read from remote repository. ci.yml name: CI on:

Manual workflow triggers in Github Actions

限于喜欢 提交于 2020-07-31 13:25:49
问题 I am setting up Github Actions for a project repository. The workflow consists of the following steps: Building a docker image Pushing the image to a container registry Rollout a Kubernetes deployment. However, I have two different Kubernetes deployments: one for development, and one for production. Hence, I have also two Github Action workflows. The Github Action workflow for development is triggered everytime that a commit is pushed: on: push: branches: - master But I don't want that for my

How to set environment variable in node.js process when deploying with github action

混江龙づ霸主 提交于 2020-07-19 11:18:08
问题 I am trying to build an CI pipeline for my node.js server using github actions. I just need to solve one issue. I need to set environment variable, so that my node.js server can access the env variable via process.env Below is the github action workflow file. name: Build and Deploy to GKE on: pull_request: branches: - master # Environment variables available to all jobs and steps in this workflow env: ENGINE_API_KEY: ${{ secrets.ENGINE_API_KEY }} jobs: setup-build-publish-deploy: name: Setup,

Not Found - PUT https://npm.pkg.github.com/package-name

☆樱花仙子☆ 提交于 2020-07-18 16:14:20
问题 I'm trying to upload a package on GPR (Github Package registry). I log in successfully: npm login --registry=https://npm.pkg.github.com and then run these command: npm set registry https://npm.pkg.github.com/ npm publish which returns this error: npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/package-name npm ERR! 404 npm ERR! 404 'package-name@version' is not in the npm registry. Seems it tries to upload a package on npm registry instead of github package registry. How should I fix

Not Found - PUT https://npm.pkg.github.com/package-name

空扰寡人 提交于 2020-07-18 16:14:18
问题 I'm trying to upload a package on GPR (Github Package registry). I log in successfully: npm login --registry=https://npm.pkg.github.com and then run these command: npm set registry https://npm.pkg.github.com/ npm publish which returns this error: npm ERR! 404 Not Found - PUT https://npm.pkg.github.com/package-name npm ERR! 404 npm ERR! 404 'package-name@version' is not in the npm registry. Seems it tries to upload a package on npm registry instead of github package registry. How should I fix