Skip to content

feat(addons): add productswitcher to sidebar [R8S-1169] #268

feat(addons): add productswitcher to sidebar [R8S-1169]

feat(addons): add productswitcher to sidebar [R8S-1169] #268

Workflow file for this run

name: ci
on:
push:
branches: ['develop']
pull_request:
branches: ['develop']
types: [opened, reopened, synchronize]
workflow_dispatch:
permissions:
contents: read
id-token: write
env:
REGISTRY: portainerci
IMAGE_NAME: portainer-run
jobs:
tag:
runs-on: ubuntu-latest
outputs:
value: ${{ steps.resolve.outputs.value }}
steps:
- name: '[preparation] resolve image tag'
id: resolve
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "value=pr-${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "value=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
build:
runs-on: ubuntu-latest
needs: tag
steps:
# Exchange the org's GitHub App credentials for a short-lived, narrowly
# scoped installation token so checkout can pull the private design-system
# submodule (the default GITHUB_TOKEN can't see a separate repo).
- name: '[preparation] fetch GitHub App token'
id: fetch-token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
with:
app-id: ${{ secrets.PORTAINER_BOT_ID }}
private-key: ${{ secrets.PORTAINER_BOT_KEY }}
owner: ${{ github.repository_owner }}
repositories: portainer-run,design-system
permission-contents: read
- name: '[preparation] checkout the current branch'
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
token: ${{ steps.fetch-token.outputs.token }}
- name: '[validation] check server syntax'
run: node --check server/server.js
- name: '[preparation] set up QEMU'
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: '[preparation] set up Docker Buildx'
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: '[execution] build multi-arch image and export as OCI tarball'
if: github.event_name == 'pull_request'
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
# Use the local checkout (with the submodule already fetched) as the
# build context, so BuildKit doesn't re-clone the repo over SSH.
context: .
push: false
load: false
platforms: linux/amd64,linux/arm64
build-args: |
PORTAINER_RUN_VERSION=${{ needs.tag.outputs.value }}
tags: ${{ env.IMAGE_NAME }}:${{ needs.tag.outputs.value }}
outputs: type=oci,dest=/tmp/image.tar
- name: '[execution] save image tag metadata'
if: github.event_name == 'pull_request'
run: |
echo "${{ needs.tag.outputs.value }}" > /tmp/image-tag.txt
- name: '[execution] upload image artifact'
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-image
path: /tmp/image.tar
retention-days: 1
- name: '[execution] upload image tag artifact'
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pr-image-tag
path: /tmp/image-tag.txt
retention-days: 1
- name: '[preparation] log in to registry'
if: github.event_name != 'pull_request'
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: '[execution] build and push multi-arch image'
if: github.event_name != 'pull_request'
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
with:
# Use the local checkout (with the submodule already fetched) as the
# build context, so BuildKit doesn't re-clone the repo over SSH.
context: .
push: true
platforms: linux/amd64,linux/arm64
build-args: |
PORTAINER_RUN_VERSION=${{ needs.tag.outputs.value }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ needs.tag.outputs.value }}
sbom: true
provenance: mode=max