Upgrade Serverless Functions (Optional)
caution
We do not recommend upgrading your container directly from CI in production. This approach hands over control to automation, which may not be suitable for critical environments. Prefer a change workflow and executing the upgrade with your CLI or in the Console UI.
1. Authentication
Unlike other actions, upgrading a container requires admin privileges. Since OIDC-generated tokens are intentionally restricted from admin permissions for security reasons, you need to set up a secret token instead.
Follow the steps below to generate such a token:
- Go to the Juno's console.
- Select your Satellite.
- On the Satellite's dashboard, navigate to the "Setup" tab.
- Click on "Add an access key".
- Generate a new key and assign it an "Administrator" (⚠️) role.
- Click "Submit".
- Upon successful creation, a new access key will be generated, and a "Secret token" will be displayed. Copy the token value and save it as an encrypted secret in your repository or organization, using the key
JUNO_TOKEN.
2. Configuration
To configure an action to upgrade your Satellite container, follow these steps:
- Create an
upgrade.ymlfile in the.github/workflowssubfolder of your repository. - Paste the following code into the file:
- npm
- yarn
- pnpm
.github/workflows/upgrade.yml
name: Upgrade Satellite Container
on:
workflow_dispatch:
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
- name: Install Dependencies
run: npm ci
- name: Build
uses: junobuild/juno-action@full
with:
args: functions build
- name: Upgrade
uses: junobuild/juno-action@full
with:
args: functions upgrade
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
.github/workflows/upgrade.yml
name: Upgrade Satellite Container
on:
workflow_dispatch:
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
- name: Enable Corepack
run: corepack enable
- name: Activate Yarn
run: corepack prepare yarn@1.x --activate
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Build
uses: junobuild/juno-action@full
with:
args: functions build
- name: Upgrade
uses: junobuild/juno-action@full
with:
args: functions upgrade
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}
.github/workflows/upgrade.yml
name: Upgrade Satellite Container
on:
workflow_dispatch:
jobs:
upgrade:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: "https://registry.npmjs.org"
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install Dependencies
run: pnpm i --frozen-lockfile
- name: Build
uses: junobuild/juno-action@full
with:
args: functions build
- name: Upgrade
uses: junobuild/juno-action@full
with:
args: functions upgrade
env:
JUNO_TOKEN: ${{ secrets.JUNO_TOKEN }}