This repository has been archived by the owner on Oct 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (56 loc) · 2.04 KB
/
ci.yaml
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
name: CI Workflow
on:
push:
branches: [ main, mas-ad ]
pull_request:
branches: [ main ]
env:
PLATFORMS: linux/amd64,linux/arm64,linux/s390x,linux/ppc64le
IMAGE_TAG: latest
jobs:
build:
runs-on: ubuntu-latest
if: github.repository_owner == 'Apicurio'
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup node
uses: actions/setup-node@master
with:
node-version: ${{matrix.node-version}}
# Open-Source Machine emulator that allows you to emulate multiple CPU architectures on your machine
- name: Set up QEMU
if: github.event_name == 'push'
uses: docker/setup-qemu-action@v1
# Docker CLI plugin for extended build capabilities with BuildKit
- name: Set up Docker Buildx
if: github.event_name == 'push'
id: buildx
uses: docker/setup-buildx-action@v1
- name: Installing dependencies
run: npm install
- name: Run production build
run: npm run build
- name: Set Image Tag
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: echo "IMAGE_TAG=latest-snapshot" >> $GITHUB_ENV
- name: Login to DockerHub Registry
if: github.event_name == 'push'
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Login to Quay.io Registry
if: github.event_name == 'push'
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: Build and Publish Multi-Arch Docker Images
if: github.event_name == 'push'
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
platforms: ${{env.PLATFORMS}}
push: true
tags: |
docker.io/apicurio/apicurio-studio-editors:${{env.IMAGE_TAG}}
quay.io/apicurio/apicurio-studio-editors:${{env.IMAGE_TAG}}