Skip to content

Commit

Permalink
Merge pull request #293 from Concordium/workflow-release-frontend
Browse files Browse the repository at this point in the history
Add release workflow and prepare frontend release
  • Loading branch information
limemloh authored Nov 6, 2024
2 parents 28aa9e2 + 2cb0188 commit 9e05d7f
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: Backend (Rust) Check formatting and build
name: Check backend (Rust)

on:
push:
branches: main
paths:
- backend-rust/**
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
paths:
- backend-rust/**

env:
RUST_FMT: "nightly-2023-04-01"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Build
name: Check backend (.NET)

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
paths:
- backend/**

env:
RUST_VERSION: "1.65"
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/frontend-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Check frontend

on:
push:
branches: main
paths:
- frontend/**
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [ main ]
paths:
- frontend/**

env:
NODE_VERSION: "18.18.2"

jobs:
checks:
name: Formatting and types
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
cache-dependency-path: frontend/yarn.lock
- name: Install deps
working-directory: frontend
run: yarn install --frozen-lockfile --immutable
- name: Check formatting
working-directory: frontend
run: yarn run formatcheck
- name: Check types
working-directory: frontend
run: yarn run typecheck
# - name: Linting
# working-directory: frontend
# run: yarn run lintcheck
48 changes: 48 additions & 0 deletions .github/workflows/frontend-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish frontend docker image on DockerHub

on:
push:
tags:
- frontend/*

jobs:
publish-docker-image:
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
flavor: latest=false
images: concordium/ccdscan-frontend
tags: type=match,pattern=frontend/(.*),group=1
- name: Ensure tag matches version in package.json
run: |
EXPECTED=$(jq -r .version frontend/package.json)
EXTRACTED="${{ steps.meta.outputs.version }}"
if [ "$EXPECTED" = "$EXTRACTED" ]; then
printf "Extracted version matches the version in package.json ($EXTRACTED).\n"
exit 0
else
printf "ERROR: Extracted version does not match the version in package.json. \nExtracted: '$EXTRACTED'\nExpected: '$EXPECTED'\n"
exit 1
fi
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tag }}
labels: ${{ steps.meta.outputs.labels }}
2 changes: 2 additions & 0 deletions frontend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

## [Unreleased]

## [1.6.0] - 2024-11-05

### Added

- Temporary maintenance banner.
Expand Down
35 changes: 0 additions & 35 deletions frontend/Jenkinsfile

This file was deleted.

6 changes: 4 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ccscan-frontend",
"description": "CCDScan frontend",
"version": "1.5.41",
"version": "1.6.0",
"engine": "16",
"type": "module",
"private": true,
Expand All @@ -13,9 +13,11 @@
"generate": "nuxt generate",
"test": "cross-env TZ=Universal jest",
"test:watch": "cross-env TZ=Universal jest --watch",
"typecheck": "vue-tsc --noEmit",
"typecheck": "nuxi typecheck",
"lint": "eslint --fix --max-warnings 0 --ext .js,.ts,.vue .",
"lintcheck": "eslint --max-warnings 0 src",
"format": "prettier src --write",
"formatcheck": "prettier src --check",
"gql-codegen": "graphql-codegen --config graphql-codegen.yml"
},
"dependencies": {
Expand Down

0 comments on commit 9e05d7f

Please sign in to comment.