This commit is contained in:
52
.gitea/workflows/deploy.yml
Normal file
52
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
name: Deploy MinIO Explorer
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
create:
|
||||
tags:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install MinIO Client
|
||||
run: |
|
||||
wget https://dl.min.io/client/mc/release/linux-amd64/mc
|
||||
chmod +x mc
|
||||
sudo mv mc /usr/local/bin/
|
||||
|
||||
- name: Prepare files for production
|
||||
run: |
|
||||
# Créer un dossier temporaire pour les fichiers de production
|
||||
mkdir -p dist
|
||||
|
||||
# Copier style.css et script.js sans modification
|
||||
cp style.css dist/
|
||||
cp script.js dist/
|
||||
|
||||
# Traiter index.html : supprimer la section de développement
|
||||
# Utiliser awk pour supprimer les lignes 15-25 (section dev-form)
|
||||
awk 'NR < 15 || NR > 25' index.html > dist/index.html
|
||||
|
||||
# Vérifier que les fichiers sont créés
|
||||
ls -la dist/
|
||||
|
||||
- name: Configure MinIO Client
|
||||
run: |
|
||||
mc alias set minio ${{ secrets.MINIO_ENDPOINT }} ${{ secrets.MINIO_ACCESS_KEY }} ${{ secrets.MINIO_SECRET_KEY }}
|
||||
|
||||
- name: Deploy to MinIO
|
||||
run: |
|
||||
# Déployer les fichiers sur le bucket
|
||||
mc cp dist/index.html minio/${{ secrets.MINIO_BUCKET }}/
|
||||
mc cp dist/style.css minio/${{ secrets.MINIO_BUCKET }}/
|
||||
mc cp dist/script.js minio/${{ secrets.MINIO_BUCKET }}/
|
||||
|
||||
# Vérifier le déploiement
|
||||
mc ls minio/${{ secrets.MINIO_BUCKET }}/
|
||||
|
||||
Reference in New Issue
Block a user