Skip to content

Merge pull request #16 from bryanlabs/fix/cosmovisor-dialog-not-showi… #23

Merge pull request #16 from bryanlabs/fix/cosmovisor-dialog-not-showi…

Merge pull request #16 from bryanlabs/fix/cosmovisor-dialog-not-showi… #23

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ '*' ]
workflow_dispatch:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
build-app:
name: Build Application
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Check environment
id: check-act
run: |
if [ -n "$ACT" ]; then
echo "running_with_act=true" >> $GITHUB_OUTPUT
else
echo "running_with_act=false" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: npm ci
- name: Build application
run: npm run build
- name: Upload build artifacts
if: steps.check-act.outputs.running_with_act != 'true'
uses: actions/upload-artifact@v4
with:
name: build-output
path: build/
retention-days: 1
build-image:
name: Build Docker Image
runs-on: ubuntu-latest
needs: build-app
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: bryanlabs/cosmos-upgrades-ui
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check environment
id: check-act
run: |
if [ -n "$ACT" ]; then
echo "running_with_act=true" >> $GITHUB_OUTPUT
else
echo "running_with_act=false" >> $GITHUB_OUTPUT
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: ${{ steps.check-act.outputs.running_with_act == 'true' && '--allow-insecure-entitlement security.insecure' || '' }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64 # Add platforms for multi-arch build
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
cache-from: ${{ steps.check-act.outputs.running_with_act != 'true' && 'type=gha' || 'type=local,src=/tmp/.buildx-cache' }}
cache-to: ${{ steps.check-act.outputs.running_with_act != 'true' && 'type=gha,mode=max' || 'type=local,dest=/tmp/.buildx-cache' }}