Skip to content

Uploads a previously-built workflow artifact to your custom deployment API, then (optionally) polls the API until it reports succeeded or failed, allowing the job to pass or fail automatically based on your backend’s result.

License

Notifications You must be signed in to change notification settings

codeless-testing/deploy-artifact-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Upload artifact to custom API ✈️

Reusable GitHub Action that

  1. downloads an artifact produced by a previous job
  2. POSTs it to your backend (api_url) with a bearer token
  3. (optionally) waits until the backend finishes a long-running task and returns succeeded or failed.

Perfect for pipelines that must ship a build bundle to an internal deploy-service, upload to S3, run end-to-end tests, etc.

Test GitHub release License


📦 Inputs

Name Required Default Description
artifact_name yes Name of the artifact to download (must be uploaded earlier in the workflow).
api_url yes Full URL of your backend’s upload endpoint.
api_token yes Bearer token passed in Authorization: Bearer … header.
poll no true true → wait until backend reports final status.
false → exit after upload.
poll_interval_seconds no 15 Seconds between status checks when polling.
poll_timeout_minutes no 30 Fail after this many minutes (0 = unlimited).

🔄 Outputs

Name When poll = true Description
result always "success" or "failure" (mirrors backend result).

🚀 Quick start

name: build-and-deploy

permissions: contents:read  #  only basic permissions needed

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: |
          npm ci && npm run build
          zip -r webapp.zip dist/
      - uses: actions/upload-artifact@v4
        with:
          name: webapp_bundle
          path: webapp.zip

  deploy:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - name: Ship bundle to backend and wait
        uses: your-org/upload-artifact-to-api@v1
        with:
          artifact_name: webapp_bundle
          api_url:       ${{ secrets.DEPLOY_API_URL }}/upload
          api_token:     ${{ secrets.UPLOAD_TOKEN }}

About

Uploads a previously-built workflow artifact to your custom deployment API, then (optionally) polls the API until it reports succeeded or failed, allowing the job to pass or fail automatically based on your backend’s result.

Resources

License

Stars

Watchers

Forks

Packages

No packages published