-
Notifications
You must be signed in to change notification settings - Fork 9
62 lines (62 loc) · 2.16 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
name: ci
run-name: ci
on:
push:
branches:
- main
jobs:
ci:
runs-on: ubuntu-latest
env:
TAG: 0.0.${{ github.run_number }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Plugins
run: |
yarn --cwd src/packages/backend add @backstage/plugin-scaffolder-backend-module-github
yarn --cwd src/packages/backend add @backstage/plugin-catalog-backend-module-github
cp packages/backend/src/index.ts src/packages/backend/src/index.ts
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.TAG }},ghcr.io/${{ github.repository }}:latest
build-args: |
SRC=src
cache-from: type=registry,ref=user/app:latest
cache-to: type=inline
platforms: linux/amd64,linux/arm64
- name: Package Helm
run: |
env
yq --inplace ".version = \"${{ env.TAG }}\"" chart/Chart.yaml
yq --inplace ".appVersion = \"${{ env.TAG }}\"" chart/Chart.yaml
helm package chart
helm push backstage-demo-${{ env.TAG }}.tgz oci://ghcr.io/${{ github.repository }}
- name: Publish Helm
uses: actions/upload-artifact@v4
with:
name: backstage-demo-helm
path: backstage-demo-${{ env.TAG }}.tgz
- name: Commit changes
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Release ${{ env.TAG }} [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}