我正在嘗試使用 Github 操作部署到 AWS。唯一的問題是,我有一個main repoandfrontend and backend submodules里面。
這是我用于部署的腳本:
name: Deploy
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Generate deployment package
run: git submodule update --init --recursive
run: zip -r deploy.zip . -x '*.git*'
- name: Get timestamp
uses: gerred/actions/current-time@master
id: current-time
- name: Run string replace
uses: frabert/replace-string-action@master
id: format-time
with:
pattern: '[:\.] '
string: "${{ steps.current-time.outputs.time }}"
replace-with: '-'
flags: 'g'
- name: Deploy to EB
uses: einaregilsson/beanstalk-deploy@v18
with:
aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_key: ${{ secrets.AWS_SECRET_KEY }}
application_name: test-stage
environment_name: Testenv-env
version_label: "${{ steps.format-time.outputs.replaced }}"
region: eu-center-1
deployment_package: deploy.zip
問題是在創建 zip 時。它不包括子模塊。沒有子模塊,專案幾乎什么都不包含。是否有可能以某種方式包含它們?或者你有更好的解決方案嗎?
uj5u.com熱心網友回復:
咨詢的actions/checkout檔案,有一個submodules引數(預設值false),該控制結帳是否包括子模塊。所以,你可能想要
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/313252.html
