ActiveCampaign / postmark-cli

The official CLI tool for Postmark
https://postmarkapp.com
MIT License
79 stars 9 forks source link

postmark: command not found (Github Actions) #52

Closed liorhar closed 2 years ago

liorhar commented 2 years ago

Trying to run postmark on Github actions. Following this guide https://postmarkapp.com/blog/managing-your-postmark-templates-with-github-using-travis-ci-or-circleci I've installed postmark globally with npm i -g postmark Installation is successful but the following step fails to execute postmark command. What am I missing? is it some bin path issue? Tested with other npm CLI libraries (e.g. serverless) work without any path manipulations.

derekrushforth commented 2 years ago

Hey @liorhar,

Apologies for the delay. I'm not entirely sure why the PM command isn't working for you. I'd have to see your YAML config in Github actions. I've put together a simple config that will get you started:

name: Push templates to Postmark

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

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

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - name: Install and push templates
      env:
        POSTMARK_SERVER_TOKEN: ${{ secrets.POSTMARK_SERVER_TOKEN }}
      run: |
        npm i postmark-cli -g
        postmark templates push ./templates -f

A few things to note:

Let me know if that works for you.

liorhar commented 2 years ago

That worked, thanks! My issue was trying to install postmark instead of postmark-cli