This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
74 lines (64 loc) · 2.13 KB
/
build.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
69
70
71
72
73
74
name: Build
on:
push:
branches:
- main
tags:
- v*
env:
MAIN_REGISTRY: ghcr.io
MAIN_USERNAME: ${{ github.actor }}
MAIN_PASSWORD: ${{ github.token }}
MAIN_REPOSITORY: ${{ github.repository }}
jobs:
setup:
uses: janus-idp/.github/.github/workflows/setup.yaml@main
with:
default_tag_version: "latest"
build_platforms: "linux/amd64,linux/arm64"
build-and-push-images:
runs-on: ubuntu-latest
needs: ["setup"]
strategy:
matrix:
platform: ${{ fromJson(needs.setup.outputs.dist_matrix) }}
steps:
- name: checkout repo
uses: actions/checkout@96f53100ba2a5449eb71d2e6604bbcd94b9449b5 # pin@v3
- uses: actions/setup-node@869f4dd0c7f320ae834c2724d92a364de3893c24 #[email protected]
with:
node-version: 18
- name: Create Backstage application
run: |
echo backstage | npx @backstage/create-app
cp ./Dockerfile ./.dockerignore ./backstage/
- name: Build and push images
uses: janus-idp/.github/.github/actions/build-and-push@main
with:
platform: ${{ matrix.platform }}
image_tag: ${{ needs.setup.outputs.image_tag }}
context: backstage
push-images-and-manifests:
runs-on: ubuntu-latest
needs: ["setup", "build-and-push-images"]
strategy:
matrix:
include:
- registry: ghcr.io
username: ${{ github.actor }}
password: GITHUB_TOKEN
repository: ${{ github.repository }}
- registry: quay.io
username: ${{ vars.QUAY_USERNAME }}
password: QUAY_TOKEN
repository: janus-idp/redhat-backstage-build
steps:
- name: Mirror images and create manifests
uses: janus-idp/.github/.github/actions/mirror-images-and-create-manifests@main
with:
image_platform_tags: ${{ needs.setup.outputs.image_platform_tags }}
image_tag: ${{ needs.setup.outputs.image_tag }}
registry: ${{ matrix.registry }}
username: ${{ matrix.username }}
password: ${{ secrets[matrix.password] }}
repository: ${{ matrix.repository }}