INT, STG 환경 모두에 대해 Matrix에서 실행되기를 원하며 각 환경에 대해 더 긴 이름(통합, 스테이징)이 필요합니다.
github 작업 내에서 이것이 가능합니까? 내가 sytanx에서 뭔가를 놓쳤습니까? 이리저리 찾아봤는데 안나오네요..
Test:
name: Deploy Test
runs-on: ${{matrix.env}}
strategy:
matrix:
env: [int, stg]
needs:
- 'jobA'
- 'jobB'
steps:
- name: Create test things.
env:
ENVIRONMENT: 'if github.runs-on == int; then $ENVIRONMENT=integration else $ENVIRONMENT=staging'
- name: Test
run: |
some command using ${{env.ENVIRONMENT}}
- Desired output is integration
some command using ${{env.ENVIRONMENT}}
- Desired output is staging
기꺼이 도와 주시면 감사하겠습니다!
runs-on
시스템 이름을 지정하는 데 사용됩니다. 여기에 사용자 지정 문자열을 넣으면 안 됩니다.
올바른 형식은 다음과 같습니다.
Test:
name: Deploy Test
runs-on: ubuntu-latest
strategy:
matrix:
env: [int, stg]
needs:
- 'jobA'
- 'jobB'
steps:
- name: Create test things.
- uses: haya14busa/action-cond@v1
id: env_name
with:
cond: ${{ matrix.env == 'int' }}
if_true: "integration"
if_false: "staging"
- name: Test environment name
run: |
some command using ${{ matrix.env }} #int / stg will be passed
echo ${{ steps.env_name.outputs.value }} # will output integration for int, staging for stg
- name: Test Staging Only
if: matrix.env == 'stg'
run: |
some command using ${{ matrix.env }} #stg only, skipped for int
# This only executes for staging
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다