Skip to content

fix ci

fix ci #997

---
name: build, push to registry and tests
on:
push:
branches-ignore:
- 'development/**'
env:
NAMESPACE: 'zenko-ui-dev'
REGISTRY: 'registry.scality.com'
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: '${{ secrets.REGISTRY_LOGIN }}'
PASSWORD: '${{ secrets.REGISTRY_PASSWORD }}'
- 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/checkout@v2.3.5
- uses: actions/setup-node@v2.4.1
with:
node-version: '16'
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: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Scality Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD}}
- name: install dependencies
run: npm config set unsafe-perm true && npm ci
- name: build assets
run: npm run build
- name: Build and push zenko ui
uses: docker/build-push-action@v2.7.0
with:
push: true
context: .
tags: |
ghcr.io/${{ github.repository }}/zenko-ui:${{ github.sha }}
${{env.REGISTRY}}/${{env.NAMESPACE}}/zenko-ui:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.5
- uses: actions/setup-node@v2.4.1
with:
node-version: '16'
cache: 'npm'
- name: install dependencies
run: npm config set unsafe-perm true && 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/codecov-action@v2.1.0