-
Notifications
You must be signed in to change notification settings - Fork 3
96 lines (82 loc) · 2.54 KB
/
build-push-tests.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
name: build, push to registry and tests
on:
push:
branches-ignore:
- "development/**"
env:
NAMESPACE: "scality/zenko-ui/dev"
REGISTRY: "ghcr.io"
jobs:
oras:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Oras
run: |
curl -LO https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz
mkdir -p oras-install/
sudo tar -zxf oras_${ORAS_VERSION}_*.tar.gz -C /usr/local/bin oras
rm -rf oras_${ORAS_VERSION}_*.tar.gz oras-install/
env:
ORAS_VERSION: "0.12.0"
- name: Oras login
run: oras login --username "${LOGIN}" --password "${PASSWORD}" ${REGISTRY}
env:
LOGIN: "${{ github.actor }}"
PASSWORD: "${{ github.token }}"
- name: push nginx and runtime-app-configuration
run: |
oras push ${REGISTRY}/${NAMESPACE}/zenko-ui-config:${{ github.sha }} \
runtime-app-configuration.gotempl:application/zenko-ui-runtime-config-template+json \
nginx.conf.gotempl:text/nginx-conf-template
build:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: "20"
cache: "npm"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: install dependencies
run: npm ci
- name: build assets
run: npm run build
- name: Build and push zenko ui
uses: docker/[email protected]
with:
push: true
context: .
tags: |
${{env.REGISTRY}}/${{env.NAMESPACE}}:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: "20"
cache: "npm"
- name: install dependencies
run: npm ci
- name: run eslint test
run: npm run test:lint
- name: run test suite
run: npm run test:coverage
- name: code coverage
uses: codecov/[email protected]