### Dockerfile for Monday App Deploy Action Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md This Dockerfile sets up a Node.js 20 environment, installs the Monday Apps CLI globally, copies an entrypoint script, and configures it to run when the container starts. ```dockerfile # write a nodejs 20 based container image and install @mondaycom/apps-cli # run the cli as the entry point and inject some provided env vars # to the container image FROM node:20-alpine RUN npm install -g @mondaycom/apps-cli # Copies your code file from your action repository to the filesystem path `/` of the container COPY entrypoint.sh /entrypoint.sh # Code file to execute when the docker container starts up (`entrypoint.sh`) ENTRYPOINT ["/entrypoint.sh"] ``` -------------------------------- ### Dockerfile Entrypoint Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Illustrates how the Docker entrypoint script receives arguments as positional parameters. ```dockerfile ENTRYPOINT ["/entrypoint.sh"] ``` -------------------------------- ### Install and Initialize Monday Apps CLI Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/README.md Installs the Monday Apps CLI globally and initializes it with your developer token. This is necessary to list your applications. ```bash npm install -g @mondaycom/apps-cli mapps init -t YOUR_TOKEN mapps app:list ``` -------------------------------- ### Build and Deploy Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This workflow first sets up the Node.js environment, installs dependencies, builds the application, and then deploys it using the monday-app-deploy-action. ```yaml - uses: actions/setup-node@v4 with: node-version: '18' - run: npm install && npm run build - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Arguments Array Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md An example of how arguments are passed to the Docker container, including input expressions. ```yaml args: - ${{ inputs.token }} - ${{ inputs.appId }} - ${{ inputs.versionId }} - ${{ inputs.force }} - ${{ inputs.working-directory }} ``` ```yaml args: - "my-token-abc123" - "10110073" - "" - "false" - "." ``` -------------------------------- ### Monorepo App Deployment Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Example of deploying a specific app from a monorepo structure. The 'working-directory' input is used to target the correct app's configuration. ```yaml working-directory: ./apps/app-1 ``` -------------------------------- ### Interactive Container Debugging Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Demonstrates how to start a Docker container interactively for debugging purposes. This allows manual installation of tools and checking their versions within the container's environment. ```bash # Start the container in shell mode docker run -it -v $(pwd):/app -w /app node:20-alpine sh # Inside the container npm install -g @mondaycom/apps-cli mapps --version ``` -------------------------------- ### Example Deployment with Specific Working Directory Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Demonstrates changing to a specific app directory and deploying the app, showing how mapps locates configuration and source files. ```bash # Working directory: ./apps/my-app cd ./apps/my-app mapps app:deploy -a 10110073 ``` -------------------------------- ### Workflow File Integration Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md A complete example of a GitHub Actions workflow step that uses the monday-app-deploy-action to deploy an application, including checking out code and providing necessary inputs. ```yaml jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Install Monday Apps CLI Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Installs the Monday Apps command-line tool globally within the Docker container using npm. ```dockerfile RUN npm install -g @mondaycom/apps-cli ``` -------------------------------- ### Test Deployment Locally Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Replicate the Monday App deployment action locally by cloning the repository, installing the mapps CLI, initializing the project, and deploying the application. ```bash # Clone the repository git clone cd /my-app # Install mapps npm install -g @mondaycom/apps-cli # Initialize mapps init -t your-token # Deploy mapps app:deploy -a 10110073 ``` -------------------------------- ### Full Monday App Deploy Action Configuration Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md A comprehensive configuration example including token, app ID, force flag, and working directory. This covers most common deployment requirements. ```yaml with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 force: false working-directory: ./my-app ``` -------------------------------- ### Deployment to Monday App with Working Directory Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/README.md This example shows how to deploy an app to monday.com when the app code resides in a subdirectory. It extends the basic deployment by specifying the 'working-directory' input. ```yaml name: Deploy app to monday on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Deploy app to monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 working-directory: ./my-app ``` -------------------------------- ### Deploying with Version ID Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Configuration example for deploying a specific version of the Monday app using its version ID. This is an alternative to deploying by app ID. ```yaml with: token: ${{ secrets.MONDAY_TOKEN }} versionId: 20220531001 ``` -------------------------------- ### Continue on Error Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Shows how to configure a step to continue running even if the monday-app-deploy-action fails, by setting `continue-on-error: true`. ```yaml - uses: mondaycom/monday-app-deploy-action@master continue-on-error: true with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 - run: echo "This runs even if deployment failed" ``` -------------------------------- ### Deploy with Environment Variables for App IDs Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md This example shows how to use environment variables to manage different App IDs for staging and production environments. This avoids hardcoding sensitive IDs directly in the workflow. ```yaml env: PROD_APP_ID: 10110073 STAGING_APP_ID: 10110076 jobs: deploy: runs-on: ubuntu-latest steps: - name: Deploy uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: ${{ env.PROD_APP_ID }} ``` -------------------------------- ### Deploy from Subdirectory Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md Use this configuration when your Monday app is located in a subdirectory within your repository, common in monorepo setups. Specify the path using `working-directory`. ```yaml - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 working-directory: ./apps/my-app ``` -------------------------------- ### Notify on deployment completion Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This example demonstrates how to deploy an app and then use a Slack action to notify about the deployment status, regardless of success or failure. ```yaml - name: Deploy id: deploy uses: mondaycom/monday-app-deploy-action@master with: token: "${{ secrets.MONDAY_TOKEN }}" appId: 10110073 - name: Notify Slack if: always() uses: slackapi/slack-github-action@v1 with: payload: | { "text": "Deployment ${{ job.status }}" } ``` -------------------------------- ### Set Container Entrypoint Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Configures the container to execute the '/entrypoint.sh' script when it starts. This uses the exec form for direct execution. ```dockerfile ENTRYPOINT ["/entrypoint.sh"] ``` -------------------------------- ### Complete Workflow with Build Step Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md A comprehensive GitHub Actions workflow that includes setting up Node.js, installing dependencies, building the app, and then deploying it. It also specifies a 'working-directory' for build steps and deployment. ```yaml name: Build and Deploy on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: '18' - name: Install Dependencies run: npm install working-directory: ./my-app - name: Build run: npm run build working-directory: ./my-app - name: Deploy to Monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 working-directory: ./my-app ``` -------------------------------- ### Pin Specific CLI Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Shows how to install a specific version of the Monday Apps CLI by appending the version number to the package name. ```dockerfile RUN npm install -g @mondaycom/apps-cli@1.2.3 ``` -------------------------------- ### Example action.yml Input Description Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Define clear descriptions for action inputs within your `action.yml` file. These descriptions are displayed in the GitHub Actions editor, Marketplace, and IDE extensions. ```yaml appId: description: | The ID of your monday app. Find your app ID using `mapps app:list` or in the Monday developer center. required: false ``` -------------------------------- ### Hypothetical Action Outputs Section Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md An example of how an 'outputs' section might be defined in `action.yml` if the action were to provide outputs, including a 'deployment-id'. ```yaml outputs: deployment-id: description: 'Deployment ID from Monday' value: ${{ steps.deploy.outputs.deployment-id }} ``` -------------------------------- ### Nested Directory Structure Deployment Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Example for deploying an app located in a nested directory. The 'working-directory' input points to the specific subdirectory containing the app's configuration. ```yaml working-directory: ./src/my-app ``` -------------------------------- ### Required Input Validation Example Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Illustrates the `required: true` setting for an input in `action.yml`, ensuring that the input must be provided for the action to run. ```yaml token: required: true ``` -------------------------------- ### Valid Input Name Examples in action.yml Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Illustrates valid naming conventions for inputs in `action.yml`. Input names must be unique and are typically lowercase, though variations with hyphens are also accepted. ```yaml inputs: appId: app-id: appid: ``` -------------------------------- ### Command Injection Example (Hypothetical) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Illustrates a potential command injection vulnerability if 'appId' input contained shell metacharacters. GitHub Actions input validation mitigates this in practice. ```bash mapps app:deploy -a ; rm -rf / ``` -------------------------------- ### Conditional Deployment (Branch-Based) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This example demonstrates how to conditionally deploy to different app IDs based on the Git branch. It deploys to one app ID if the ref is 'main', and another otherwise. ```yaml - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: ${{ github.ref == 'refs/heads/main' && '10110073' || '10110074' }} ``` -------------------------------- ### Conditional Deployment with Matrix Strategy Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Example of a conditional deployment configuration that utilizes GitHub Actions matrix strategy for the working directory. The force flag is also conditionally set based on the branch. ```yaml with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 force: ${{ github.ref == 'refs/heads/main' && 'true' || 'false' }} working-directory: ${{ matrix.app-directory }} ``` -------------------------------- ### Check Installed CLI Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Checks the currently installed version of the mapps CLI. ```bash mapps --version ``` -------------------------------- ### Complete Execution Sequence Overview Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Visualizes the entire deployment process from the GitHub Actions runner to the final exit code. ```text GitHub Actions Runner ↓ Reads action.yml and inputs ↓ Starts Docker container with node:20-alpine ↓ npm install -g @mondaycom/apps-cli (from Dockerfile) ↓ COPY entrypoint.sh /entrypoint.sh ↓ Runs /entrypoint.sh with 5 arguments ↓ entrypoint.sh: 1. Extract inputs → shell variables 2. mapps init -t 3. Build CLI arguments 4. [Optional] Change to working directory 5. mapps app:deploy [flags] ↓ Returns exit code (0 = success, 1+ = failure) ↓ GitHub Actions marks step as success or failure ``` -------------------------------- ### Integrating Build and Deploy Steps Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Demonstrates how to use the same 'working-directory' for both build and deploy steps in a GitHub Actions workflow for consistency. This ensures the build process targets the correct app subdirectory. ```yaml - name: Build run: npm run build working-directory: ./my-app - name: Deploy uses: mondaycom/monday-app-deploy-action@master with: working-directory: ./my-app # ... other inputs ``` -------------------------------- ### Show App Details Command Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Displays detailed information about a specific app. ```bash mapps app:details ``` -------------------------------- ### Minimal Usage Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This is the most basic configuration to deploy an app. It requires a Monday developer token and the app ID. ```yaml - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Clone Repository and Build Docker Image Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Steps to clone the repository and build the Docker image for the action. ```bash git clone cd monday-app-deploy-action docker build -t monday-deploy . ``` -------------------------------- ### Run Docker Container with Inputs Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Execute the Docker container with necessary input parameters for deployment. ```bash docker run monday-deploy \ "your-token" \ "10110073" \ "" \ "" \ ". ``` -------------------------------- ### Basic Deployment Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md A fundamental GitHub Actions workflow to deploy a Monday App. It checks out the code and then uses the deploy action with a token and app ID. ```yaml name: Deploy Monday App on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Deploy to Monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Force Deploy to App (with init) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys to a specified app, forcing the deployment to the live version if necessary. This command requires the app to exist and may overwrite the live version. ```bash mapps init -t mytoken mapps app:deploy -a 10110073 -f ``` -------------------------------- ### Basic Deployment to Monday App Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/README.md This snippet demonstrates a basic workflow for deploying an app to monday.com. It requires a checkout step and the deploy action itself, using a secret token and a specified app ID. ```yaml name: Deploy app to monday on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Deploy app to monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Deploy App Command Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys an app after loading stored credentials, validating options and configuration, building, packaging, and uploading the app to Monday. ```bash mapps app:deploy [options] ``` -------------------------------- ### Securely Use GitHub Secrets for Tokens Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md This example demonstrates the correct way to use GitHub secrets for authentication tokens. Avoid hardcoding tokens or using environment variables that are not secret-based. ```yaml token: ${{ secrets.MONDAY_TOKEN }} # ✅ Correct ``` ```yaml token: "abc123def456..." # ❌ Hardcoded token ``` ```yaml token: ${{ env.MONDAY_TOKEN }} # ❌ Env var (unless secret-based) ``` -------------------------------- ### Deploy from Subdirectory Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys an app located in a subdirectory. Ensure the working directory is set to the app's directory before running the deploy command. This command fails if the directory does not exist or its configuration is invalid. ```bash mapps init -t mytoken cd ./my-app mapps app:deploy -a 10110073 ``` -------------------------------- ### List All Apps Command Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Lists all available apps, useful for finding app IDs required for other commands. ```bash mapps app:list ``` -------------------------------- ### Execute Deployment Command Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md The core command for deploying a Monday app. It accepts optional arguments for app ID, version ID, and a force flag. ```bash mapps app:deploy $APP_ID_ARG $VERSION_ID_ARG $FORCE_ARG ``` -------------------------------- ### Complete action.yml File Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Defines the metadata, inputs, and execution details for the Monday App Deploy GitHub Action. ```yaml # action.yml name: 'Monday App Deploy' description: 'Deploy app to Monday code' inputs: token: description: 'Monday developer token' required: true appId: description: 'The ID of your monday app' required: false versionId: description: 'The version ID of your monday app' required: false force: description: 'Force deploy to live version' required: false default: false working-directory: description: 'Working directory' required: false default: '.' runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.token }} - ${{ inputs.appId }} - ${{ inputs.versionId }} - ${{ inputs.force }} - ${{ inputs.working-directory }} ``` -------------------------------- ### List App Versions Command Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Lists all versions of a specific app, useful for finding version IDs. ```bash mapps app-version:list -a 10110073 ``` -------------------------------- ### Pin mapps CLI Version in Dockerfile Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Specifies a fixed version for the mapps CLI during the npm install process. This ensures consistent behavior across different action runs by preventing unexpected updates to the CLI. ```dockerfile RUN npm install -g @mondaycom/apps-cli@1.0.0 ``` -------------------------------- ### Make entrypoint.sh Executable Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Provides the necessary bash commands to make the entrypoint.sh script executable within the Git repository, resolving 'permission denied' errors. ```bash chmod +x entrypoint.sh git add entrypoint.sh git commit -m "Make entrypoint.sh executable" ``` -------------------------------- ### Docker Build and Run Commands Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Illustrates the sequence of Docker commands GitHub Actions executes: first building the image from the Dockerfile, then running the container with mounted workspace and arguments. ```bash # GitHub Actions builds the image docker build -f Dockerfile -t github-actions-container:latest . # Then runs it docker run \ -v /github/workspace:/github/workspace \ -w /github/workspace \ github-actions-container:latest \ ``` -------------------------------- ### Deploy from Subdirectory Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Deploys an app located in a subdirectory. Requires changing to the app's directory before deployment. ```bash mapps init -t $TOKEN cd ./my-app mapps app:deploy -a 10110073 ``` -------------------------------- ### Execution Summary Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This outlines the execution flow of the action, from input processing to the final deployment command and output. ```text Input: token, appId, versionId, force, working-directory ↓ Docker container starts (node:20-alpine) ↓ mapps init -t ↓ [Optional] cd ↓ mapps app:deploy [-a appId] [-v versionId] [-f] ↓ Output: Exit code 0 (success) or 1+ (failure) ``` -------------------------------- ### Sequential deployment to multiple apps Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This snippet illustrates how to deploy to multiple applications sequentially by specifying a different `working-directory` for each deployment step. ```yaml steps: - uses: actions/checkout@v4 - uses: mondaycom/monday-app-deploy-action@master with: token: "${{ secrets.MONDAY_TOKEN }}" appId: 10110073 working-directory: ./app-1 - uses: mondaycom/monday-app-deploy-action@master with: token: "${{ secrets.MONDAY_TOKEN }}" appId: 10110074 working-directory: ./app-2 ``` -------------------------------- ### Force Deploy to Live Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Deploys to a specified app, forcing the update to the live version if necessary. Requires token, app ID, and the force flag. ```bash mapps init -t $TOKEN mapps app:deploy -a 10110073 -f ``` -------------------------------- ### Reference Action Format Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Shows the basic syntax for referencing the monday-app-deploy-action in a workflow file, including the use of a reference (ref) and input parameters. ```yaml uses: mondaycom/monday-app-deploy-action@ with: : ``` -------------------------------- ### Force Deployment to Live Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md Use the 'force: true' option to overwrite the live version of the app. This is useful for immediate updates but should be used with caution. ```yaml - name: Force Deploy to Live uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 force: true ``` -------------------------------- ### Basic GitHub Actions Workflow for Deployment Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/README.md This workflow deploys your Monday app on a push to the main branch. Ensure you have set up the MONDAY_TOKEN secret in your GitHub repository settings. ```yaml name: Deploy on: push: branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: mondaycom/monday-app-deploy-action@master with: token: "${{ secrets.MONDAY_TOKEN }}" appId: YOUR_APP_ID ``` -------------------------------- ### Basic Deployment Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md A simple workflow that deploys on every push to the main branch. Suitable for single apps with no build step required. ```yaml name: Deploy to Monday on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deploy to Monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Build and Deploy Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md Workflow that includes a build step using Node.js and npm before deploying the app. Best practice for apps requiring compilation or bundling. ```yaml name: Build and Deploy on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' - name: Install Dependencies run: npm install - name: Build run: npm run build - name: Deploy to Monday uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Minimal Monday App Deploy Action Configuration Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md The most basic configuration for the deploy action, requiring only the authentication token and the application ID. This is suitable for simple deployment scenarios. ```yaml with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 ``` -------------------------------- ### Deploy to App (No Force) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Deploys to the latest draft version of a specified app. Requires a token and app ID. ```bash mapps init -t $TOKEN mapps app:deploy -a 10110073 ``` -------------------------------- ### List App Versions Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Lists all versions of a Monday.com app along with their respective IDs. This command is useful for finding Version IDs to use with `mapps app:deploy -v`. ```bash mapps app-version:list ``` -------------------------------- ### Dockerfile for Monday App Deploy Action Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Defines the Docker environment for the action, including Node.js, npm, the Monday CLI, and the entrypoint script. ```dockerfile FROM node:20-alpine RUN npm install -g @mondaycom/apps-cli COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] ``` -------------------------------- ### Pinning Action to Specific Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md Demonstrates how to pin the monday-app-deploy-action to a specific version tag (e.g., v1.0.0), a branch (e.g., master), or a commit hash for stable deployments. ```yaml # Use a specific version uses: mondaycom/monday-app-deploy-action@v1.0.0 # Use a branch uses: mondaycom/monday-app-deploy-action@master # Use a commit hash uses: mondaycom/monday-app-deploy-action@abc1234 ``` -------------------------------- ### Build Docker Image Locally Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Builds the Docker image for the Monday App Deploy Action using the local Dockerfile. This command tags the image as 'monday-deploy:latest' for easy reference. ```bash docker build -t monday-deploy:latest . ``` -------------------------------- ### Initialize mapps CLI with Token Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Authenticates the mapps CLI with the Monday platform using the provided developer token. This command must succeed for deployment to proceed and stores authentication credentials for subsequent commands. ```bash mapps init -t $TOKEN ``` -------------------------------- ### Deploy App to Monday Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys a Monday.com app. Use either an App ID to deploy the latest draft or a Version ID to deploy a specific version. The force flag can bypass restrictions. ```bash mapps app:deploy [options] ``` ```bash mapps app:deploy [APP_ID_ARG] [VERSION_ID_ARG] [FORCE_ARG] ``` -------------------------------- ### Deploy to App (No Force) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys to the latest draft version of a specified app. This command will fail if no draft version exists for the app. ```bash mapps init -t mytoken mapps app:deploy -a 10110073 ``` -------------------------------- ### Manual Deployment Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md Allows for manual triggering of the deployment via GitHub Actions `workflow_dispatch` event. The `appId` can be provided as an input during manual execution. ```yaml on: workflow_dispatch: inputs: appId: description: 'App ID' required: true jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: ${{ github.event.inputs.appId }} ``` -------------------------------- ### Deploy to Specific Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys to a specific version of an app, identified by its version ID. This command will fail if the specified version does not exist. ```bash mapps init -t mytoken mapps app:deploy -v 20220531001 ``` -------------------------------- ### Runs Section Configuration Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Defines how the action runs, specifying Docker usage, image, and arguments. ```yaml runs: using: 'docker' image: 'Dockerfile' args: - ${{ inputs.token }} - ${{ inputs.appId }} - ${{ inputs.versionId }} - ${{ inputs.force }} - ${{ inputs.working-directory }} ``` -------------------------------- ### Manual Deployment Workflow Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md Trigger deployments on-demand by providing App ID and optional Version ID. Useful for hotfixes or deploying to specific versions without committing code. ```yaml name: Deploy (Manual) on: workflow_dispatch: inputs: app-id: description: 'Monday App ID' required: true default: '10110073' version-id: description: 'Monday Version ID (optional, leave blank for draft)' required: false jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deploy uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: ${{ github.event.inputs.app-id }} versionId: ${{ github.event.inputs.version-id }} ``` -------------------------------- ### Test Deployment Before Production Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md Deploys to a test app first, and only proceeds to production if the test deployment is successful. Helps validate configuration and catch errors early. ```yaml name: Deploy (Test First) on: push: branches: - main jobs: deploy-test: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deploy to Test uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110099 # Test app deploy-prod: needs: deploy-test runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deploy to Production uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 # Prod app ``` -------------------------------- ### Deploy to Specific Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md This snippet shows how to deploy a specific version of a Monday App using the 'versionId' input. Ensure the versionId is valid and corresponds to an existing app version. ```yaml - name: Deploy to Specific Version uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} versionId: 20220531001 ``` -------------------------------- ### Configuration File Structure Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Defines the structure of the monday.config.json file, including required fields for app deployment. ```json { "appId": 10110073, "name": "My Monday App", "version": "1.0.0", "description": "My app description", "main": "dist/index.js", "scripts": { "build": "tsc", "start": "node dist/index.js" }, "dependencies": { "react": "^18.0.0" } } ``` -------------------------------- ### Initialize Authentication Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Initializes mapps authentication by validating a token with the Monday API and storing credentials locally. Returns exit code 0 on success. ```bash mapps init -t ``` -------------------------------- ### Action Definition Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/action-reference.md Defines the GitHub Action for deploying Monday apps. It runs using a Docker image and executes a deployment script. ```yaml name: 'Monday App Deploy' description: 'Deploy app to Monday code' runs: using: 'docker' image: 'Dockerfile' ``` -------------------------------- ### Deploy to Specific Version Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/execution-flow.md Deploys to a particular version of an app, regardless of its status. Requires a token and version ID. ```bash mapps init -t $TOKEN mapps app:deploy -v 20220531001 ``` -------------------------------- ### Run tests before deploying an app Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md This snippet shows how to run npm tests before initiating the app deployment. The deployment step is conditional on the tests passing successfully. ```yaml - name: Run Tests run: npm test - name: Deploy if: success() uses: mondaycom/monday-app-deploy-action@master with: token: "${{ secrets.MONDAY_TOKEN }}" appId: 10110073 ``` -------------------------------- ### Working Directory Configuration Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Specifies the working directory for the action. Defaults to the repository root if not provided. ```yaml working-directory: description: 'Working directory' required: false default: '.' ``` -------------------------------- ### Copy Entrypoint Script Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/docker-configuration.md Copies the 'entrypoint.sh' script from the action's repository root into the Docker container at the '/entrypoint.sh' path. ```dockerfile COPY entrypoint.sh /entrypoint.sh ``` -------------------------------- ### Deploy Multiple Apps in Monorepo (Single Job) Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md Use a single job with sequential steps for simpler, albeit slower, deployment of multiple apps. This approach is easier to manage but takes longer to complete. ```yaml jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '18' - name: Deploy App One uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 working-directory: ./apps/app-one - name: Deploy App Two uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110074 working-directory: ./apps/app-two ``` -------------------------------- ### Input Expression Syntax Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/github-actions-integration.md Demonstrates the use of GitHub Actions expression syntax for accessing inputs. ```yaml args: - ${{ inputs.token }} ``` -------------------------------- ### Deploy with Version ID Fallback Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md This snippet shows how to deploy a specific version of a Monday app, falling back to a known good version ID if none is provided in the event inputs. This is useful for maintaining stability. ```yaml - name: Deploy uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} versionId: ${{ github.event.inputs.version-id || '20220531001' }} # Default to known good version ``` -------------------------------- ### Force Deploy to App Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Use the force flag to deploy to an app, bypassing normal restrictions like the absence of a draft version. This can be used for emergency hotfixes or when a draft version is unavailable. Use with caution as it may overwrite the current live version. ```bash mapps app:deploy -a 10110073 -f ``` -------------------------------- ### Staged Deployment Workflow by Branch Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/usage-patterns.md Deploy to different environments (Dev, Staging, Production) based on the Git branch. Ensures correct app configuration for each environment. ```yaml name: Deploy (Staged) on: push: branches: - develop - staging - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Deploy to Dev if: github.ref == 'refs/heads/develop' uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110075 # Dev app - name: Deploy to Staging if: github.ref == 'refs/heads/staging' uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110076 # Staging app - name: Deploy to Production if: github.ref == 'refs/heads/main' uses: mondaycom/monday-app-deploy-action@master with: token: ${{ secrets.MONDAY_TOKEN }} appId: 10110073 # Prod app force: true ``` -------------------------------- ### Entrypoint Script Arguments Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Inputs are passed to the entrypoint script as positional arguments in a specific order. Each argument is quoted to preserve values with spaces. ```bash /entrypoint.sh ``` -------------------------------- ### Deploy to Specific Version ID Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/mapps-cli-reference.md Deploys a specific version of a Monday.com app directly using its Version ID. This method works regardless of the version's status (draft, live, deprecated). ```bash mapps app:deploy -v 20220531001 ``` -------------------------------- ### Specify Working Directory for Deployment Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/inputs-specification.md Sets the working directory for the deployment command, useful when the Monday app code resides in a subdirectory. The specified directory must exist and contain the Monday app configuration. ```yaml working-directory: ./my-app ``` -------------------------------- ### Complete Input Specification Source: https://github.com/mondaycom/monday-app-deploy-action/blob/master/_autodocs/quick-reference.md Defines all available inputs for the action, including token, appId, versionId, force, and working-directory. Note that appId and versionId are mutually exclusive. ```yaml inputs: token: description: 'Monday developer token' required: true appId: description: 'The ID of your monday app' required: false versionId: description: 'The version ID of your monday app' required: false force: description: 'Force deploy to live version' required: false default: false working-directory: description: 'Working directory' required: false default: '.' ```