SalesforceCommerceCloud / sfcc-ci

Salesforce Commerce Cloud CLI
https://npmjs.com/package/sfcc-ci
BSD 3-Clause "New" or "Revised" License
229 stars 91 forks source link

GitHub Actions #159

Open gokaygurcan opened 4 years ago

gokaygurcan commented 4 years ago

Hi,

It'd be really nice if we have this package as a GitHub Action. So that we could do something like:

name: Deploy Code
on: [ push ]

env:
    SFCC_OAUTH_CLIENT_ID: ${{ secrets.SFCC_OAUTH_CLIENT_ID }}
    SFCC_OAUTH_CLIENT_SECRET: ${{ secrets.SFCC_OAUTH_CLIENT_SECRET }}
    SFCC_OAUTH_USER_NAME: ${{ secrets.SFCC_OAUTH_USER_NAME }}
    SFCC_OAUTH_USER_PASSWORD: ${{ secrets.SFCC_OAUTH_USER_PASSWORD }}

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
      - name: zip
        uses: montudor/action-zip@v0.1.0
        with:
          args: zip -qq -r ./output/code.zip ./cartridges
      - name: code:deploy
        uses: SalesforceCommerceCloud/sfcc-ci@latest
        id: deploy
        run: code:deploy ./output/code.zip -i ${{ secrets.INSTANCE_URL }}

I don't know, this might not be a good example and might not even work, but should be enough to understand the idea.

tobiaslohr commented 4 years ago

Hi @gokaygurcan, thanks for the proposal, I like the idea. Can you share some more thoughts about details you'd like to see for the Github Action itself?

Trimud commented 3 years ago

Hi @gokaygurcan, you may want to consider https://www.npmjs.com/package/execa

Or what I did was to clone the repo using "actions/checkout@v2", running npm install and after this npm link. After this you can use sfcc-ci as you are in a terminal.

gokaygurcan commented 3 years ago

I think with this holiday season and low amount of releases, I can take a look at this and try to make it work. Stay tuned.

rbknajera commented 3 years ago

Do we have any news about this? I'm about to create a workflow on GitHub actions for my projects ci/cd and having this would be great

gokaygurcan commented 3 years ago

Tbh, I'm busy with other things and can't really tell when I can finish anything close to be useful. So, please don't wait up for me if you're waiting for any working solution. execa is a good alternative as suggested above, in github-script action you can call sfcc-ci with the parameters you want and parse the response as you like.