【发布时间】:2021-12-15 15:25:23
【问题描述】:
我想隐藏我的 API 密钥,但我想同时在 GitHub 页面部署中使用这些密钥。我刚刚为 GitHub Actions 工作流创建了那个 .yml 文件。如何从 .vue 文件中访问这些密钥?
工作: # 作业将运行的运行器类型 运行:ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Run a one-line script
run: echo ${{secrets.SERVICE_API}}
env:
SERVICE_API: ${{secrets.SERVICE_API}}
API_KEY: ${{secrets.API_KEY}}
【问题讨论】:
标签: vue.js github deployment github-pages github-actions