-
Notifications
You must be signed in to change notification settings - Fork 36
82 lines (70 loc) · 2.77 KB
/
release-apps.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release Apps
on:
release:
types: [ published ]
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
env:
APPS: 'legacy-api,playground-api,status-api,whale-api'
jobs:
build:
if: github.event_name != 'pull_request' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
name: Publish
runs-on: ubuntu-latest
strategy:
matrix:
app: [ legacy-api, playground-api, status-api, whale-api ]
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up QEMU
uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # v2.5.0
- name: Login to GitHub Container Registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Resolve Tags
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
id: tags
env:
APP: ${{ matrix.app }}
with:
script: return require('./.github/scripts/release-tags.js')({ context })
result-encoding: string
- name: Build & Publish
uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # v3.3.1
with:
push: true
build-args: APP=${{ matrix.app }}
platforms: |
linux/amd64
linux/arm64
tags: ${{ steps.tags.outputs.result }}
cache-from: type=registry,ref=ghcr.io/birthdayresearch/jellyfish:buildcache
cache-to: type=registry,ref=ghcr.io/birthdayresearch/jellyfish:buildcache,mode=max
report:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
name: Report
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Create Report
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
id: report
with:
script: return require('./.github/scripts/release-report.js')({ context })
result-encoding: string
- name: Post Report
uses: marocchino/sticky-pull-request-comment@3d60a5b2dae89d44e0c6ddc69dd7536aec2071cd # v2.5.0
with:
header: release
message: ${{ steps.report.outputs.result }}