68 lines
1.5 KiB
YAML
68 lines
1.5 KiB
YAML
name: Deploy static content to Pages
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
branches: [ 'main' ]
|
|
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: 'pages'
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
check:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BASE: /osmfilter/
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
- run: npm install --frozen-lockfile
|
|
- name: Build project
|
|
run: npm run check-all
|
|
|
|
deploy:
|
|
needs: check
|
|
environment:
|
|
name: github-pages
|
|
runs-on: ubuntu-latest
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
BASE: /osmfilter/
|
|
VITE_ROUTER: hash
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
cache: 'npm'
|
|
- run: npm install --frozen-lockfile
|
|
- name: Build project
|
|
run: npm run build-only
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: './dist'
|
|
- name: Minio Deploy
|
|
uses: passidel/minio-deploy-action@v1
|
|
with:
|
|
endpoint: ${{ secrets.MINIO_ENDPOINT }}
|
|
access_key: ${{ secrets.MINIO_ACCESS_KEY }}
|
|
secret_key: ${{ secrets.MINIO_SECRET_KEY }}
|
|
bucket: 'swarm-static-websites'
|
|
source_dir: './dist'
|
|
target_dir: '/pascal.syma.dev/osmfilter/' |