Git Product home page Git Product logo

aio-apps-action's Introduction

Build Status License

aio-apps-action

Adobe Developer App Builder support for GitHub actions. This action leverages AIO CLI to build, test and deploy App Builder applications.

Getting Started

This Github action supports following commands

  1. build - Builds App Builder application. This is similar to using aio app build command using AIO CLI
  2. test - Test App Builder application. This is similar to using aio app test command using AIO CLI
  3. deploy - Deploys App Builder application. This is similar to running aio app deploy --skip-build command using AIO CLI. Deploy Command also supports --no-publish flag for aio app deploy command to control publishing of Extensions. See usage section for more details.
  4. auth - Generates IMS Token and adds that to Github Action Environment for AIO CLI to use. The token is required to build and deploy App Builder Extensions.

Prerequisites for Commands

  1. build

    • Standalone App
      1. AIO_RUNTIME_NAMESPACE - namespace to be used for the App
    • Extensions
      1. AIO_RUNTIME_NAMESPACE - namespace to be used for the App
      2. AUTH command should have been executed prior to build to make sure required token is available
  2. test - None

  3. deploy

    • Standalone App
      1. AIO_RUNTIME_NAMESPACE - namespace to be used for the App
      2. AIO_RUNTIME_AUTH - auth for abobe namespace
    • Extensions
      1. AIO_RUNTIME_NAMESPACE - namespace to be used for the App
      2. AIO_RUNTIME_AUTH - auth for abobe namespace
      3. AIO_PROJECT_ID - Adobe I/O Console project ID
      4. AIO_PROJECT_NAME - Adobe I/O Console project name
      5. AIO_PROJECT_ORG_ID - IMS Org id
      6. AIO_PROJECT_WORKSPACE_ID - Workspace Id
      7. AIO_PROJECT_WORKSPACE_NAME - Workspace name
      8. AIO_PROJECT_WORKSPACE_DETAILS_SERVICES - list of services added to above workspace in following format (ex. '[{"code": "AdobeIOManagementAPISDK", "name": "I/O Management API"}]' )
      9. AUTH command should have been executed prior to build to make sure required token is available in case extensions are to be published. Else use noPublish command flag to disbale app publish
  4. auth

    • Standalone App auth command is not required for standalone Apps
    • Extensions
      1. CLIENTID - Client id for the Adobe I/O console project
      2. CLIENTSECRET - Client secret for the Adobe I/O console project
      3. TECHNICALACCOUNTID - Technical account Id for the Adobe I/O console project
      4. IMSORGID - IMS Org Id
      5. SCOPES - Comma separated list of required scopes for JWT token.
      6. KEY - Private key associated with project

Command Usage and required params

You can include the action in your workflow as adobe/aio-apps-action@ Example :

For Standalone App

name: AIO App CI

on:
  release:
    types: [released]
jobs:
  deploy:
    name: Deploy to Prod
    runs-on: ${{ matrix.os }}
    strategy:
      max-parallel: 1
      matrix:
        node-version: ['12']
        os: [ubuntu-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: npm install
        run: npm i
      - name: Setup CLI
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          version: 8.x.x
      - name: Build
        env:
          AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }}
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          command: build
      - name: Deploy
        env:
          AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }}
          AIO_RUNTIME_AUTH: ${{ secrets.AIO_RUNTIME_AUTH_PROD }}
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          command: deploy
Set noPublish flag for Deploy command to true/false to control publishing of Extensions
name: AIO App CI

on:
  release:
    types: [released]
jobs:
  deploy:
    name: Deploy to Prod
    runs-on: ${{ matrix.os }}
    strategy:
      max-parallel: 1
      matrix:
        node-version: ['12']
        os: [ubuntu-latest]
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - name: npm install
        run: npm i
      - name: Setup CLI
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          version: 8.x.x
      - name: Auth
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          command: auth
          CLIENTID: ${{ secrets.CLIENTID_PROD }}
          CLIENTSECRET: ${{ secrets.CLIENTSECRET_PROD }}
          TECHNICALACCOUNTID: ${{ secrets.TECHNICALACCID_PROD }}
          IMSORGID: ${{ secrets.IMSORGID_PROD }}
          SCOPES: ${{ secrets.SCOPES_PROD }}
          KEY: ${{ secrets.KEY_PROD }}
      - name: Build
        env:
          AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }}
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          command: build
      - name: Deploy
        env:
          AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }}
          AIO_RUNTIME_AUTH: ${{ secrets.AIO_RUNTIME_AUTH_PROD }}
          AIO_PROJECT_ID: ${{ secrets.AIO_PROJECT_ID_PROD }}
          AIO_PROJECT_NAME: ${{ secrets.AIO_PROJECT_NAME_PROD }}
          AIO_PROJECT_ORG_ID: ${{ secrets.AIO_PROJECT_ORG_ID_PROD }}
          AIO_PROJECT_WORKSPACE_ID: ${{ secrets.AIO_PROJECT_WORKSPACE_ID_PROD }}
          AIO_PROJECT_WORKSPACE_NAME: ${{ secrets.AIO_PROJECT_WORKSPACE_NAME_PROD }}
          AIO_PROJECT_WORKSPACE_DETAILS_SERVICES: ${{ secrets.AIO_PROJECT_WORKSPACE_DETAILS_SERVICES_PROD }}
        uses: adobe/[email protected]
        with:
          os: ${{ matrix.os }}
          command: deploy
          noPublish: false

Running from a sub-directory

If the aio project is not in the root directory of your repository, you can specify the working directory by passing workin-directory as a string to the with parameter in your workflow yaml file. Example:

- name: Build
  env:
    AIO_RUNTIME_NAMESPACE: ${{ secrets.AIO_RUNTIME_NAMESPACE_PROD }}
  uses: adobe/[email protected]
  with:
    working-directory: './some-sub-dir'
    os: ${{ matrix.os }}
    command: build

Contributing

Contributions are welcomed! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

aio-apps-action's People

Contributors

amulyakashyap09 avatar hannessolo avatar himavanth avatar meryllblanchet avatar purplecabbage avatar sandeep-paliwal avatar shazron avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.