我最近创建了这篇文章,试图弄清楚如何在 GitHub 操作中引用 GitHub Secrets。我相信我已经解决并弄清楚了这个问题,并且我正在解决另一个问题。
下面是目前工作流程代码的示例,我需要帮助的问题是这Create and populate .Renviron file部分。
on: [push, pull_request]
name: CI-CD
jobs:
CI-CD:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
# we keep a matrix for convenience, but we would typically just run on one
# single OS and R version, aligned with the target deployment environment
matrix:
config:
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
env:
# Enable RStudio Package Manager to speed up package installation …Run Code Online (Sandbox Code Playgroud) 您好,我即将完成使用 GitHub 操作添加 CI/CD 步骤来部署我拥有的 R Shiny 应用程序。我遇到的问题是 R 中有一个名为的文件.Renviron,我用它来存储在 R 脚本中访问我的 SQL 数据库的凭据。通常,我在本地部署应用程序,并且在使用 rsconnect 包时包含此文件,但现在我使用 GitHub 操作,我相信我必须在 bash 脚本步骤中自己手动创建此 .Renviron 文件。
下面是我的 github 工作流程代码现在的样子。我遇到的问题是零件Create and populate .Renviron file。
# Triggered on push and pull request events
on: [push, pull_request]
# Name of the workflow => usethis::use_github_actions_badge("CI-CD")
name: CI-CD
jobs:
CI-CD:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
# we keep a matrix for convenience, but we would typically just run …Run Code Online (Sandbox Code Playgroud) continuous-integration r continuous-deployment github-actions
aws_security_group.jacobs_rds_security_group_tf当我运行 .Terraform 项目时,我的 Terraform 项目似乎总是就地修改此资源terraform apply。一切仍然有效,只是当我总是有一个额外的资源被修改时,即使它没有任何改变,它只会让调试变得奇怪。
我有2个安全组;1 用于我的 RDS 数据库,它将传入流量列入白名单,另一个用于任务,它附加到我的 ECS 和 Lambda 任务,以便它们可以访问此 RDS 数据库。任务安全组已列入 RDS 安全组白名单。
RDS 安全组 ( aws_security_group.jacobs_rds_security_group_tf) 是始终进行就地修改的组。下面是代码。
resource "aws_vpc" "jacobs_vpc_tf" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
}
resource "aws_security_group" "jacobs_task_security_group_tf"{
name = "jacobs_security_group for tasks"
description = "Connect Tasks to RDS"
vpc_id = aws_vpc.jacobs_vpc_tf.id
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
egress {
from_port = 0
to_port = …Run Code Online (Sandbox Code Playgroud)