github-actions

Deploy individual services from a monorepo using github actions

微笑、不失礼 提交于 2020-06-27 08:37:22
问题 I have around 10 individual micro-services which are mostly cloud functions for various data processing jobs, which all live in a single github repository. The goal is to trigger the selective deployment of these service to Google Cloud Functions, on push to a branch - when an individual function has been updated. I must avoid the situation in which update of a single service causes the deployment of all the cloud functions. My current repository structure: /repo --/service_A ----/function --

In GitHub Actions, can I return back a value to be used as a condition later?

落花浮王杯 提交于 2020-06-25 03:35:27
问题 I'm setting up GitHub Actions as a CI for one of my projects, and the entire build process is basically a PowerShell script, driven by environment variables. This is both to minimize vendor lock in, and to make sure I can run a build locally with pretty much the same process. Now, my build script determines some stuff and puts it into environment variables - specifically, I have an MH_IS_PROD_BUILD variable that's either True or False, and determines which nuget package repository I push to.

GitHub Actions: how to target all branches EXCEPT master?

一笑奈何 提交于 2020-06-24 22:41:32
问题 I want to be able to let an action run on any given branch except master. I am aware that there is a prebuilt filter action, but I want the exact opposite. More like GitLab's except keyword. Since this is not inside the official docs, has anyone prepared a decent workaround? Thank you very much. 回答1: The documentation has been updated with more information now: When you specify a branches or tags filter, the workflow only runs if at least one pattern matches . Any changes to branches or tags

How to force to exit in Github Actions step

随声附和 提交于 2020-06-23 06:51:13
问题 I want to exit job if a specific condition is met: jobs: foo: steps: ... - name: Early exit run: exit_with_success # I want to know what command I should write here if: true - run: foo - run: ... ... How to do that? 回答1: There is currently no way to exit a job arbitrarily, but there is a way to allow skipping subsequent steps if an earlier step failed, by using conditionals: jobs: foo: steps: ... - name: Early exit run: exit_with_success # I want to know what command I should write here - if:

Dependencies Between Workflows on Github Actions

☆樱花仙子☆ 提交于 2020-06-23 05:50:06
问题 I have a monorepo with two workflows: .github/workflows/test.yml name: test on: [push, pull_request] jobs: test-packages: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - name: test packages run: | yarn install yarn test ... .github/workflows/deploy.yml deploy-packages: runs-on: ubuntu-latest needs: test-packages steps: - uses: actions/checkout@v1 - name: deploy packages run: | yarn deploy env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} ... This doesn't work, I can't reference a job

Git history in a Github Action

ε祈祈猫儿з 提交于 2020-06-17 09:33:10
问题 I would like to log the git history in a Github Action. But it seems that the Action's environment has a different one: echo $(git log -5 --oneline) shell: /bin/bash -e {0} 7c0faa6 Merge c245982a87ef5538d42ab905706faa08f4d67ce9 into 8a939ef1f71eaecac0ae52d625dad3e3c9fa4c16 This is not a git log and none of these hashes matches what I have in my repo. Why is that? How to access the commit history from the environment of a Github Action? 回答1: You are experiencing this because your workflow is

Github Actions: [remote rejected] master -> master (shallow update not allowed), error: failed to push some refs

亡梦爱人 提交于 2020-06-17 08:04:10
问题 In my Github workflow, I am checking out two repositories. Subsequently I merge two directories of the workflow repo "repoA" with repo "repoB". When pushing to repoB, I get an error: From ../repoA * [new branch] master -> workspace/master Automatic merge went well; stopped before committing as requested [master cbd72fe] Update To https://github.com/username/repoB.git ! [remote rejected] master -> master (shallow update not allowed) error: failed to push some refs to 'https://username@github

Cant Install Tensorflow 2.2.0rc0 in Ubuntu with Github Actions inside setup.py

一笑奈何 提交于 2020-06-16 02:38:27
问题 When i try to install tensorflow>=2.2.0rc0 from setup.py running python setup.py install from a Github Actions Workflow, the output sendme this: Searching for tensorflow>=2.2.0rc0 Reading https://pypi.org/simple/tensorflow/ No local packages or working download links found for tensorflow>=2.2.0rc0 error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.2.0rc0') ##[error]Process completed with exit code 1. This is my Github Action Workflow: name: Test Deblurrer on:

Cant Install Tensorflow 2.2.0rc0 in Ubuntu with Github Actions inside setup.py

亡梦爱人 提交于 2020-06-16 02:38:17
问题 When i try to install tensorflow>=2.2.0rc0 from setup.py running python setup.py install from a Github Actions Workflow, the output sendme this: Searching for tensorflow>=2.2.0rc0 Reading https://pypi.org/simple/tensorflow/ No local packages or working download links found for tensorflow>=2.2.0rc0 error: Could not find suitable distribution for Requirement.parse('tensorflow>=2.2.0rc0') ##[error]Process completed with exit code 1. This is my Github Action Workflow: name: Test Deblurrer on:

Run firebase emulators on github actions

僤鯓⒐⒋嵵緔 提交于 2020-06-16 02:37:40
问题 I'm trying to run my test on Github Actinos but after several attempts I was not able to do so. Receiving Error: firestore: Firestore Emulator has exited because java is not installed, you can install it from https://openjdk.java.net/install/ - name: Test uses: w9jds/firebase-action@v1.3.1 env: JAVA_HOME: ${{ env.JAVA_HOME }} FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }} GCLOUD_PROJECT: ${{ secrets.nextGCLOUD_PROJECT }} PROJECT_ID: ${{ secrets.nextFIREBASE_PROJECTID }} with: args: | setup