mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-17 16:50:22 +00:00
86 lines
2.9 KiB
YAML
86 lines
2.9 KiB
YAML
# N.B.: This won't run on releases because of
|
|
# https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow.
|
|
# However, we also have a companion deploy that's part of the release.yml workflow.
|
|
name: Companion Edge Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: ['main']
|
|
paths:
|
|
- 'packages/@uppy/companion/**'
|
|
- '.github/workflows/companion-deploy.yml'
|
|
|
|
env:
|
|
YARN_ENABLE_GLOBAL_CACHE: false
|
|
|
|
jobs:
|
|
npm:
|
|
name: Generate npm tarball
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v6
|
|
- name: Set SHA commit in version
|
|
run:
|
|
(cd packages/@uppy/companion && node -e 'const
|
|
pkg=require("./package.json");pkg.version+="+${{ github.sha
|
|
}}";fs.writeFileSync("package.json",JSON.stringify(pkg, undefined,
|
|
2)+"\n")')
|
|
- name: Create Companion tarball
|
|
run:
|
|
corepack yarn workspace @uppy/companion pack --install-if-needed -o
|
|
/tmp/companion-${{ github.sha }}.tar.gz
|
|
- name: Upload artifact
|
|
if: success()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: companion-${{ github.sha }}.tar.gz
|
|
path: /tmp/companion-${{ github.sha }}.tar.gz
|
|
|
|
docker:
|
|
name: DockerHub (${{ matrix.platform }})
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-24.04
|
|
platform: linux/amd64
|
|
platform_tag: amd64
|
|
- runner: ubuntu-24.04-arm
|
|
platform: linux/arm64
|
|
platform_tag: arm64
|
|
runs-on: ${{ matrix.runner }}
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@v6
|
|
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
|
|
- name: Log in to DockerHub
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Build and push
|
|
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
|
|
with:
|
|
push: true
|
|
context: .
|
|
platforms: ${{ matrix.platform }}
|
|
file: Dockerfile
|
|
tags: transloadit/companion:edge-${{ matrix.platform_tag }}
|
|
|
|
docker-manifest:
|
|
name: DockerHub manifest
|
|
needs: docker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
|
|
- name: Log in to DockerHub
|
|
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
- name: Publish edge manifest
|
|
run: |
|
|
docker buildx imagetools create \
|
|
--tag transloadit/companion:edge \
|
|
transloadit/companion:edge-amd64 \
|
|
transloadit/companion:edge-arm64
|