Skip to content

Commit

Permalink
fix prod pipeline, step outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jotacemarin committed Feb 9, 2024
1 parent 403726f commit e86b86f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/cd-prod-botnorrea-v2-telegram.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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/[email protected]
with:
Expand All @@ -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 }}
Expand Down

0 comments on commit e86b86f

Please sign in to comment.