forked from transloadit/uppy
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (61 loc) · 2.15 KB
/
companion-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# 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:
- yarn.lock
- 'packages/@uppy/companion/**'
- '.github/workflows/companion-deploy.yml'
jobs:
npm:
name: Generate npm tarball
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- 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@v3
with:
name: companion-${{ github.sha }}.tar.gz
path: /tmp/companion-${{ github.sha }}.tar.gz
docker:
name: DockerHub
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 0
COMPOSE_DOCKER_CLI_BUILD: 0
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v4
with:
images: transloadit/companion
tags: |
type=edge
type=raw,value=latest,enable=false
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- name: Log in to DockerHub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKER_USERNAME}}
password: ${{secrets.DOCKER_PASSWORD}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}