Skip to content

CI

CI #156

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
workflow_run:
workflows: ["Bump version and create release"]
types:
- completed
workflow_dispatch: # allow manual start
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
REGISTRY_USER: ${{ github.repository_owner }}
REGISTRY_PASS: ${{ secrets.GITHUB_TOKEN }}
IMAGE_NAME: ${{ github.repository }}
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
# - name: Bump patch version
# uses: callowayproject/bump-my-version@master
# with:
# args: patch --no-commit --verbose
- uses: actions/setup-python@v6
with:
python-version: '3.12'
- run: |
python -m pip install click==8.2 bump-my-version==0.32.2
bump-my-version bump patch --no-commit --verbose
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: Build
working-directory: frontend
run: |
echo "VITE_BASE_PATH=/OpenNumismatWeb/dev/" > .env.local
echo "VITE_SERVERLESS=1" >> .env.local
npm run build
rm .env.local
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./frontend/dist
destination_dir: dev
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to ${{ env.REGISTRY }} registry
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASS }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
#type=semver,pattern={{major}}.{{minor}}
#type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}