我将命令heroku run -a ${{ secrets.HEROKU_APP_NAME }} python manage.py migrate设置为在将 master 推送到 Heroku 后运行。它运行没有错误(下面是输出):
Running python manage.py migrate on ***... ?
Running python manage.py migrate on ***... done
Run Code Online (Sandbox Code Playgroud)
但迁移实际上并没有运行。可能是什么问题呢?
我无法在 github 操作中运行我的 python Selenium。
过去一年我一直在使用 Circle CI,但最近开始迁移到 github 操作。
为了让 Circle CI 在 Chrome 浏览器中运行 selenium,我的 config.yml 中有以下几行:
docker:
# includes chrome browser for selenium testing
- image: circleci/python:3.7.4-browsers
Run Code Online (Sandbox Code Playgroud)
并且似乎不需要安装 chromedriver。
我在我的 githubs action .yml 文件中使用以下内容:
jobs:
build:
runs-on: ubuntu-latest
services:
selenium:
image: selenium/standalone-chrome
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install
- name: Prepare …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 Github Actions 为我的 angular 项目设置 CI 到 firebase,但我有一个临时环境和生产环境,我想根据我推送到的分支部署到每个环境。
我知道我可以为我的master和dev分支创建两个不同的工作流脚本,但我无法弄清楚如何使用w9jds/firebase-action.
当我使用脚本时:
on:
push:
branches:
- dev
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build-prod
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Download Artifact
uses: …Run Code Online (Sandbox Code Playgroud) github firebase firebase-hosting firebase-cli github-actions
是否有通过 GitHub Actions复制和重命名文件的智能方法?我想将一些自述/docs文件复制到文件夹中(:= 同一个 repo,而不是远程一个!),它们将根据它们的 frontmatter 重命名title。
目标是拥有某种自动更新文档系统,每次我推送 Jekyll 时都会自动填充。
我可以在我的本地命令行中使用我的 friebase 应用程序(https://github.com/Luuuuuis/profile-page)firebase deploy,但是当我推送它时,它一直失败 -> 没有代码错误。
这是我的 GitHub 操作:https : //github.com/Luuuuuis/profile-page/blob/master/.github/workflows/main.yml 并且在尝试构建时失败。https://github.com/Luuuuuis/profile-page/runs/792416930?check_suite_focus=true
这是我得到的错误:
Error: EACCES: permission denied, open '/usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/index.js'
at Object.openSync (fs.js:443:3)
at Object.writeFileSync (fs.js:1194:35)
at /usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/detect.js:35:15
at Object. (/usr/local/lib/node_modules/firebase-tools/node_modules/storage-engine/lib/compatibility/detect.js:45:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/firebase-tools/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE …
我有一个用于 PR 的 GitHub Action 工作流程,其中包含一个执行一些 NET Core 虚拟测试的作业,这些测试需要 PostgreSQL + SQL Serve 的实例。
工作定义:
run-test:
needs: [lint-commit, lint-code]
strategy:
matrix:
os: [ubuntu-latest]
dotnet: [3.1.201]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Build the docker-compose stack
run: docker-compose --file "./MessingUp.Tests/docker-compose.yml" up --detach
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Run Tests
run: dotnet test
Run Code Online (Sandbox Code Playgroud)
和 docker compose 文件,./MessingUp.Tests/docker-compose.yml:
version: "3.7"
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-CU3-ubuntu-18.04
restart: unless-stopped …Run Code Online (Sandbox Code Playgroud) 在 GitHub Actions 工作流定义文件中,有一组您可以在表达式中使用的内置函数。
例如: ${{ toJson(github) }}
是否有任何可以在表达式中使用的字符串操作函数,例如toLowerCase?
文档页面没有提到任何内容。但是,我想知道 Github 是否在幕后使用某种标准模板/表达式 eval 库,它提供了更多的开箱即用功能。
我想将工件上传到最新版本...... 而不创建新版本。
我从github官方操作upload-release-asset开始上传神器。
它需要一个upload_url作为输入,告诉它发布的url。
这通常取自在上一步中使用create-release操作创建发布。
我试图从 create_release- 打印输出 url
https://uploads.github.com/repos/atiqg/test/releases/28579698/assets{?name,label}
Run Code Online (Sandbox Code Playgroud)
然后我将其更改为直接发布到最新版本-
https://uploads.github.com/repos/atiqg/test/releases/latest/assets
Run Code Online (Sandbox Code Playgroud)
显然没有解决并抛出这个错误 -
##[error]Multipart form data required
Run Code Online (Sandbox Code Playgroud)
有什么办法可以做到这一点吗?我不想从操作中创建新版本。
我想正常创建发布然后操作应该将工件上传到最新版本...
我想使用 GitHub 包为 GitHub 组织中的多个存储库存储 Maven 工件。目前,似乎对于每个项目,都需要一个单独的 (Maven) 存储库配置条目来指向该 (GitHub) 存储库的 Maven 存储库:
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/OWNER/REPOSITORY</url>
</repository>
Run Code Online (Sandbox Code Playgroud)
将要发布的Maven项目对应的配置是:
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub OWNER Apache Maven Packages</name>
<url>https://maven.pkg.github.com/OWNER/REPOSITORY</url>
</repository>
</distributionManagement>
Run Code Online (Sandbox Code Playgroud)
有没有办法将软件包配置为全部转到单个 REPOSITORY?将 REPOSITORY 设置为组织中不同的现有或不存在 (GitHub) 存储库会导致构建失败,完全删除 /REPOSITORY 也是如此
github package-management maven github-actions github-package-registry
我正在使用 pipenv 为 GitHub 操作安装 python 依赖项。这是我的 pipfile 的样子:
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
pylint = "*"
[packages]
pandas = "*"
pygithub = "*"
matplotlib = "*"
[requires]
python_version = "3.8"
Run Code Online (Sandbox Code Playgroud)
这是 Dockerfile 的样子:
FROM python:3
COPY main.py /
COPY Pipfile /
COPY Pipfile.lock /
COPY views.csv /
# https://github.com/pypa/pipenv/issues/4273
RUN pip install 'pipenv==2018.11.26'
RUN pipenv install --deploy --ignore-pipfile
ENTRYPOINT ["pipenv", "run", "python", "./main.py"
Run Code Online (Sandbox Code Playgroud)
我可以在我的机器上本地运行 docker 镜像,一切都按预期工作,但是当我将它推送到 GitHub 时,它失败了:
Virtualenv location: /github/home/.local/share/virtualenvs/workspace-0SZQOxG8
Traceback (most recent …Run Code Online (Sandbox Code Playgroud) github-actions ×10
github ×6
python ×3
docker ×2
firebase ×2
django ×1
firebase-cli ×1
git ×1
github-api ×1
github-pages ×1
heroku ×1
maven ×1
node.js ×1
npm ×1
pipenv ×1
selenium ×1