GitHub Actions

How to integrate GitHub Actions with Cloudsmith

The Cloudsmith GitHub Action allows you to use the Cloudsmith CLI to upload/push packages to Cloudsmith repositories. It currently supports pushing:

No Code Uploading

The Cloudsmith CLI gives you full control when connecting to any CI/CD process; allowing you to upload any of our support formats or query your repositories. Just configure your API Key, install the CLI, and you'll be all set.

cloudsmith-github-action
Github Action to push to Cloudsmith

Adding your API Key to GitHub

Retrieve your Cloudsmith API Key.

You will need to add a secret to your GitHub repository named CLOUDSMITH_API_KEY, with the value of your API-Key. Secrets are added through your GitHub repository settings, please see the Creating and Storing Encrypted Secrets documentation on GitHub for further details.

Pass your CLOUDSMITH_API_KEY secret to the Action as per the examples


Examples

Push Alpine Package

name: Cloudsmith Push Alpine Package
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Alpine Push
    steps:
      - uses: actions/[email protected]
      - name: Push
        id: push
        uses: cloudsmith-io/[email protected]
        with:
          api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
          command: "push"
          owner: 'OWNER'             # Your Cloudsmith account name or org name (namespace) 
          repo: 'REPOSITORY'         # Your Cloudsmith Repository name (slug)
          distro: "DISTRIBUTION"     # Your Distribution  (i.e alpine/v3.9)
          republish: "true"          # needed if version is not changing
          file: "YOUR-FILENAME.apk"  # Alpine package filename

Push Dart Package

name: Push Dart
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Dart Push Demo
    steps:
      - uses: actions/[email protected]
      - name: Push
        id: push
        uses: cloudsmith-io/[email protected]
        with:
          api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
          command: "push"
          format: "dart"
          owner: 'OWNER'               # Your Cloudsmith account name or org name (namespace) 
          repo: 'REPOSITORY'           # Your Cloudsmith Repository name (slug)
          republish: "true"            # needed ONLY if version is not changing
          file: "YOUR-FILENAME.tar.gz" # Dart package filename

Push Debian Package

name: Cloudsmith Push Debian Package
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Debian Push
    steps:
    - uses: actions/[email protected]
    - name: Push
      id: push
      uses: cloudsmith-io/[email protected]
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'deb'
        owner: 'OWNER'             # Your Cloudsmith account name or org name (namespace) 
        repo: 'REPOSITORY'         # Your Cloudsmith Repository name (slug)
        distro: 'DISTRIBUTION'     # Your Distribution  (i.e Debian, Ubuntu)
        release: 'RELEASE'         # Your Distribution Release (i.e xenial, buster) 
        republish: 'true'          # needed ONLY if version is not changing
        file: 'YOUR-FILENAME.deb'  # debian package filename

Push Docker Image

name: Cloudsmith Push Docker Image
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Docker Push
    steps:
    - uses: actions/[email protected]
    - name: Push
      id: push
      uses: cloudsmith-io/[email protected]
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'docker'
        owner: 'OWNER'             # Your Cloudsmith account name or org name (namespace) 
        repo: 'REPOSITORY'         # Your Cloudsmith Repository name (slug)
        republish: 'true'          # needed ONLY if version is not changing
        file: 'IMAGE-FILE.tar.gz'  # docker image filename

Push Helm Chart

name: Cloudsmith Push Helm
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Helm Push
    steps:
      - uses: actions/[email protected]
      - name: Push
        id: push
        uses: cloudsmith-io/[email protected]
        with:
          api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
          command: 'push'
          format: 'helm'
          owner: 'OWNER'               # Your Cloudsmith account name or org name (namespace) 
          repo: 'REPOSITORY'           # Your Cloudsmith Repository name (slug)
          republish: 'true'            # needed ONLY if version is not changing
          file: 'YOUR-FILENAME.tar.gz' # helm chart filename

Push Python Package

name: Cloudsmith Push Python
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Python Push
    steps:
      - uses: actions/[email protected]
      - name: Push
        id: push
        uses: cloudsmith-io/[email protected]
        with:
          api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
          command: "push"
          format: "python"
          owner: 'OWNER'               # Your Cloudsmith account name or org name (namespace) 
          repo: 'REPOSITORY'           # Your Cloudsmith Repository name (slug)
          republish: 'true'            # needed ONLY if version is not changing
          file: "YOUR-FILENAME.tar.gz" # Python package filename

Push RPM package

name: Cloudsmith Push RedHat/RPM
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: RedHat/RPM Push Demo
    steps:
      - uses: actions/[email protected]
      - name: Push
        id: push
        uses: cloudsmith-io/[email protected]
        with:
          api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
          command: "push"
          format: "rpm"
          owner: 'OWNER'             # Your Cloudsmith account name or org name (namespace) 
          repo: 'REPOSITORY'         # Your Cloudsmith Repository name (slug)
          distro: 'DISTRIBUTION'     # Your Distribution  (i.e el, fedora)
          release: 'RELEASE'         # Your Distribution Release (i.e 7, 32) 
          republish: 'true'          # needed ONLY if version is not changing
          file: "YOUR-FILENAME.rpm"  #rpm package filename

Push Raw File

name: Cloudsmith Push Raw File
on: push
jobs:
  push:
    runs-on: ubuntu-latest
    name: Raw Push
    steps:
    - uses: actions/[email protected]
    - name: Push
      id: push
      uses: cloudsmith-io/[email protected]
      with:
        api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
        command: 'push'
        format: 'raw'
        owner: 'OWNER'              # Your Cloudsmith account name or org name (namespace) 
        repo: 'REPOSITORY'          # Your Cloudsmith Repository name (slug)
        file: 'FILENAME.txt'        # Name of file 
        name: 'NAME'                # Name for Raw package
        summary: 'SUMMARY'          # Optional Summary for Raw Package
        description: 'DESCRIPTION'  # Optional description for Raw package
        version: ${{ github.sha }}


Did this page help you?