Publish npm packages, NuGet packages, and Docker images to DepAegis directly from your GitHub Actions workflows. This guide covers token setup, example workflows, caching, and release automation.
Store your DepAegis Personal Access Token as a GitHub secret so workflows can authenticate without exposing credentials.
DEPAEGIS_TOKEN and paste the token value.A minimal workflow that publishes an npm package when you push a version tag:
# .github/workflows/publish-npm.yml
name: Publish npm Package
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://app.depaegis.com/"
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.DEPAEGIS_TOKEN }}registry-url in setup-node automatically writes a project-level .npmrc with the correct registry. You do not need a separate .npmrc file in the repo.Build and push a .NET package to DepAegis after a version tag:
# .github/workflows/publish-nuget.yml
name: Publish NuGet Package
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"
- run: dotnet pack MyPackage.csproj -c Release -o ./artifacts
- run: |
dotnet nuget push ./artifacts/*.nupkg \
--source "https://nuget.app.depaegis.com/api/v1/nuget/v3/index.json" \
--api-key "${{ secrets.DEPAEGIS_TOKEN }}" \
--skip-duplicate--skip-duplicate flag prevents workflow failures if the same version is published twice (e.g. on a re-run).Build and push a Docker image to the DepAegis container registry:
# .github/workflows/publish-docker.yml
name: Publish Docker Image
on:
push:
tags:
- "v*"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to DepAegis Container Registry
uses: docker/login-action@v3
with:
registry: app.depaegis.com
username: "${{ github.actor }}"
password: "${{ secrets.DEPAEGIS_TOKEN }}"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
app.depaegis.com/my-org/my-app:${{ github.ref_name }}
app.depaegis.com/my-org/my-app:latestDepAegis supports OpenID Connect (OIDC) for keyless authentication with GitHub Actions. Instead of storing a long-lived token, the workflow exchanges a short-lived JWT from GitHub for a DepAegis access token.
* for all repos) and allowed branches.# .github/workflows/publish-oidc.yml
name: Publish with OIDC
on:
push:
branches: [main]
permissions:
id-token: write # Required for OIDC
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Exchange OIDC token for DepAegis token
id: depaegis-auth
uses: depaegis/action-oidc-auth@v1
with:
registry: app.depaegis.com
org: my-org
- name: Publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ steps.depaegis-auth.outputs.token }}Speed up your workflows by caching package downloads between runs.
# Add to your workflow job steps
- name: Cache npm
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-# setup-dotnet action caches automatically, but for explicit control:
- name: Cache NuGet
uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-# Use buildx with cache-to/cache-from
- name: Build and push with cache
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: app.depaegis.com/my-org/my-app:latest
cache-from: type=gha
cache-to: type=gha,mode=maxA complete workflow that runs tests, publishes an npm package, pushes a Docker image, and creates a GitHub release:
# .github/workflows/release.yml
name: Release
on:
push:
tags: ["v*"]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: npm ci
- run: npm test
publish-npm:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://app.depaegis.com/"
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.DEPAEGIS_TOKEN }}
publish-docker:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: app.depaegis.com
username: "${{ github.actor }}"
password: "${{ secrets.DEPAEGIS_TOKEN }}"
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
app.depaegis.com/my-org/my-app:${{ github.ref_name }}
app.depaegis.com/my-org/my-app:latest
release:
needs: [publish-npm, publish-docker]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: softprops/action-gh-release@v2
with:
generate_release_notes: trueTo ensure only reviewed code gets published:
v*) is pushed. Tags on protected branches require maintainer permissions.# .github/workflows/tag-and-release.yml
name: Create Release Tag
on:
push:
branches: [main]
jobs:
tag:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: "20"
- run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
npm version patch -m "chore: release %s"
git push --follow-tagsmain (unless the commit message contains skip ci). Ensure your main branch is protected and requires review before merging.