我正在使用Github Actions构建docker映像,并想用分支名称标记映像,我只找到了GITHUB_REF变量,但结果是refs/heads/feature-branch-1,我只需要feature-branch-1。
使用 GitHub actions 矩阵策略,您可以指定您希望代码运行的 python 版本(例如),那么是否需要在 GitHub actions 工作流程中运行 tox?
是否有任何毒素提供了 gh 行动矩阵策略所没有的东西?
谢谢!
我刚刚为 GitHub 存储库设置了 CI/CD。
唯一仍然困扰我的是,CD 构建也会自动触发拉取请求,但我不知道在哪里可以配置这些检查。
我想在这里摆脱持续交付构建。
但这对我来说也没有明显的影响。
continuous-integration continuous-deployment azure-pipelines github-actions
我一直在尝试将 Google Cloud Build 与我的 GitHub 帐户集成。我过去曾为 GCP 上的其他项目设置过工作构建触发器 - 但对于这个,我无法让它可靠地工作。这是我所做的:
现在,当手动运行默认触发器时,在选择分支后我总是收到以下错误消息:“无法触发构建:请求包含无效参数。” 看起来是这样的:
当通过 GitHub 存储库中的新提交调用时,触发器也不起作用。我通过 GitHub UI 发现了两个不同的错误:
到目前为止,我已经尝试过以下一些措施来缓解该问题:
github google-cloud-platform google-cloud-build github-actions
当我想要下载工件时,我使用以下类型的 URL:https://github.com/some_user/some_repo/suites/some_id/artifacts/some_id。.zip然而,即使结果只是一个文件,这也总是引导我找到一个包。就我而言,这个附加层完全是多余的,我想跳过它(当我构建一个我希望能够方便预览的 pdf 时,这尤其烦人)。
(如何)我可以设置自动化工作流程来公开解压的文件吗?
我有这个 GitHub 操作作业来构建 Docker 映像并将其发布到 GitHub 注册表。
...
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Push to GitHub Packages
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
registry: docker.pkg.github.com
repository: myrepo/myimg
tag_with_ref: true
Run Code Online (Sandbox Code Playgroud)
但是它在父目录中运行,而我Dockerfile的在里面app/。
.
|- .github/workflow/ci.yaml
|- README
|- app/
|- Dockerfile
|- package.json
|- package.lock.json
|- node_modules/
|- src/
|- ...
Run Code Online (Sandbox Code Playgroud)
我尝试设置working-directory: …
我正在尝试用 Github Actions 取代我们 iOS 项目糟糕的 Jenkins 设置。我想我已经准备好了所有的部分,但我遇到了一个我不明白的失败。在我运行构建和测试应用程序的步骤中xcodebuild,我收到了一个xcpretty未知命令的错误,尽管在上一步中是通过捆绑程序安装的。以下是相关文件:
构建并运行.yml
---
name: Build & Test
on:
# Run tests when a PR merges.
push:
branches:
- develop
# Run tests when PRs are created or updated.
pull_request:
types: [opened, synchronize, reopened]
# Allow the workflow to be run manually.
workflow_dispatch:
env:
DEVELOPER_DIR: /Applications/Xcode_12.app/Contents/Developer
jobs:
test:
name: Build & Test
runs-on: 'macos-latest'
steps:
- name: Checkout Project
uses: actions/checkout@v2
with:
ref: develop
- name: Setup Ruby
uses: ruby/setup-ruby@v1.46.0 …Run Code Online (Sandbox Code Playgroud) 我正在尝试创建网络流程以在 Play 商店上发布应用程序。
这是代码:
- name: Upload to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ SERVICE_ACCOUNT_JSON }}
packageName: packagename
releaseFile: app/release/app.aab
track: internal
whatsNewDirectory: distribution/whatsnew
Run Code Online (Sandbox Code Playgroud)
但无法理解如何在 serviceAccountJson 键处传递 JSON 服务帐户文件位置?
我需要将文件存储在本地并传递路径还是需要将文件添加到Github Secret中?
github google-play google-play-developer-api google-play-console github-actions
我有一个 Github 存储库,其中包含一些 Linux 实用程序。
为了运行测试,我使用 GitHub 操作和一些简单的自定义工作流程,这些工作流程使用自托管运行器在远程 Linux 服务器上运行:
name: CMake
on: [push]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
- name: Build
working-directory: ${{runner.workspace}}/Utils
shell: bash
run: cmake --build . --config $BUILD_TYPE
- name: Run test
working-directory: ${{runner.workspace}}/Utils
shell: bash
run: ./testing/test.sh
Run Code Online (Sandbox Code Playgroud)
工作流程非常简单 - 我使用编译源代码cmake,然后运行来自同一存储库的脚本来测试构建。测试脚本是一个 bash 脚本,如下所示:
#!/bin/bash
export LD_LIBRARY_PATH=/path/to/bin
cd /path/to/bin
echo -e "Starting the tests"
./run_server &
./run_tests
if [ $? -eq 0 ]; then
echo "successful"
else
echo "failed" …Run Code Online (Sandbox Code Playgroud) 我有 github 操作工作流程,概述了启动 terraform 以在 Azure 中创建资源的简单过程。我缺少的是如何集成 terraform 状态文件,以便在顺序运行此工作流程时,它应该将当前状态与 main.tf 文件进行比较,并且只允许净更改。目前,如果我按顺序运行此命令,第二次总是会失败,因为资源已经在 Azure 中创建。
如何配置下面的 github 工作流程以允许 terraform 状态文件比较?,我还没有找到执行此操作的单个来源
github操作工作流程:
name: Terraform deploy to Azur
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@master
- name: "Terraform Init"
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 0.12.13
tf_actions_subcommand: "init"
- name: "Terraform Plan"
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: 0.12.13
tf_actions_subcommand: "plan"
args: -var="client_secret=${{ secrets.clientSecret }}"
-var="client_id=${{ secrets.clientId }}"
-var="tenant_id=${{ secrets.tenantId }}"
-var="sub=${{ secrets.sub }}"
- name: "Terraform Apply"
uses: hashicorp/terraform-github-actions@master
with: …Run Code Online (Sandbox Code Playgroud) github-actions ×10
github ×6
artifact ×1
docker ×1
dockerfile ×1
google-play ×1
ios ×1
rubygems ×1
terraform ×1
tox ×1
xcodebuild ×1