如何在github工作流中添加git凭据

如何在github工作流中添加git凭据,git,github,automation,continuous-deployment,Git,Github,Automation,Continuous Deployment,问题: 如何在GitHub工作流中添加git凭据 nodejs.yml name: Node CI on: push: branches: - master - gh-pages jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [8.x, 10.x] steps: - uses: actions/c

问题:

如何在
GitHub
工作流中添加git凭据

nodejs.yml

name: Node CI

on:
  push:
    branches: 
      - master
      - gh-pages 

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x, 10.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm run deploy
      run: |
        npm install
        npm run deploy  
      env:
        CI: t
name: Node CI

on:
  push:
    branches: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x]

    steps:
    - uses: actions/checkout@v1

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - uses: fusion-engineering/setup-git-credentials@v2
      with:
        credentials: ${{secrets.GIT_CREDENTIAL}}

    - name: npm run deploy
      run: |
        export GIT_USER=${{secrets.GIT_USER}}
        git config --global user.name "$GIT_USER"
        git config --global user.email "hi@pushe.co"
        npm install
        npm run deploy  
      env:
        CI: true

它有一个功能,请检查。

我这样修复了它:

nodejs.yml

name: Node CI

on:
  push:
    branches: 
      - master
      - gh-pages 

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x, 10.x]

    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm run deploy
      run: |
        npm install
        npm run deploy  
      env:
        CI: t
name: Node CI

on:
  push:
    branches: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [8.x]

    steps:
    - uses: actions/checkout@v1

    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}

    - uses: fusion-engineering/setup-git-credentials@v2
      with:
        credentials: ${{secrets.GIT_CREDENTIAL}}

    - name: npm run deploy
      run: |
        export GIT_USER=${{secrets.GIT_USER}}
        git config --global user.name "$GIT_USER"
        git config --global user.email "hi@pushe.co"
        npm install
        npm run deploy  
      env:
        CI: true

这是什么?Travis CI?github工作流和操作