diff --git a/.github/workflows/cd-prod-botnorrea-v2-telegram.yml b/.github/workflows/cd-prod-botnorrea-v2-telegram.yml index 60625c6..5eb11d2 100644 --- a/.github/workflows/cd-prod-botnorrea-v2-telegram.yml +++ b/.github/workflows/cd-prod-botnorrea-v2-telegram.yml @@ -17,13 +17,14 @@ jobs: # Obtener el nombre del autor del commit - name: Get commit author + id: get_commit_author run: | author=$(git log -1 --format='%an') - echo "author=$author" + echo "::set-output name=autor_commit::$author" # Create new git tag - name: Create new git tag - if: ${{ author != 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit != 'botnorrea-v2' }} run: | git config --global user.email "${{ secrets.BOTNORREA_V2_EMAIL }}" git config --global user.name "${{ secrets.BOTNORREA_V2_NAME }}" @@ -32,19 +33,19 @@ jobs: # Deploy to production - name: Using Node.js ${{ matrix.node-version }} - if: ${{ author == 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit == 'botnorrea-v2' }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Install dependencies - if: ${{ author == 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit == 'botnorrea-v2' }} run: | npm install -g serverless npm i - name: Create JSON - if: ${{ author == 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit == 'botnorrea-v2' }} id: create-json uses: jsdaniell/create-json@v1.2.3 with: @@ -53,11 +54,11 @@ jobs: dir: "config/" - name: Setup credentials - if: ${{ author == 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit == 'botnorrea-v2' }} run: serverless config credentials --provider aws --key ${{ secrets.KEY_ID }} --secret ${{ secrets.SECRET_ACCESS_KEY }} --profile ${{ secrets.PROFILE }} - name: Deploy - if: ${{ author == 'botnorrea-v2' }} + if: ${{ steps.obtener_autor_commit.outputs.autor_commit == 'botnorrea-v2' }} run: npm run prod:deploy env: AWS_ACCESS_KEY_ID: ${{ secrets.KEY_ID }}