remove gitlab ci, add forgejo ci
Some checks failed
Deploy / Deploy to Production (push) Failing after 6s
Some checks failed
Deploy / Deploy to Production (push) Failing after 6s
This commit is contained in:
parent
778265feab
commit
ac2ccf01e2
7 changed files with 128 additions and 38 deletions
34
.forgejo/workflows/deploy.yml
Normal file
34
.forgejo/workflows/deploy.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Production
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth 1 --branch main https://forge.studio-variable.com/${{ github.repository }}.git .
|
||||
ls -la
|
||||
|
||||
- name: Deploy via FTP
|
||||
env:
|
||||
USERNAME: ${{ secrets.USERNAME }}
|
||||
PASSWORD: ${{ secrets.PASSWORD }}
|
||||
PREPRODUCTION_HOST: ${{ secrets.PREPRODUCTION_HOST }}
|
||||
run: |
|
||||
apt-get update -qq && apt-get install -y -qq lftp
|
||||
cat > /tmp/lftp-script.txt <<SCRIPT
|
||||
set ftp:ssl-allow no
|
||||
open -u $USERNAME,$PASSWORD $PREPRODUCTION_HOST
|
||||
mirror --reverse --verbose --ignore-time --parallel=10 -x local/ assets assets
|
||||
mirror --reverse --verbose --ignore-time --parallel=10 -x accounts/ -x cache/ -x sessions/ -x header.php site site
|
||||
mirror --reverse --verbose --ignore-time --parallel=10 kirby kirby
|
||||
mirror --reverse --verbose --ignore-time --parallel=10 vendor vendor
|
||||
quit
|
||||
SCRIPT
|
||||
lftp -f /tmp/lftp-script.txt
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
stages:
|
||||
- install
|
||||
- deploy
|
||||
|
||||
install:
|
||||
stage: install
|
||||
image: composer:2.7
|
||||
cache:
|
||||
key: composer
|
||||
paths:
|
||||
- vendor/
|
||||
- ~/.composer/cache
|
||||
script:
|
||||
- composer install --ignore-platform-req=ext-gd --no-dev --no-interaction --prefer-dist --optimize-autoloader
|
||||
artifacts:
|
||||
paths:
|
||||
- vendor/
|
||||
|
||||
deploy:
|
||||
stage: deploy
|
||||
image: alpine:3.20
|
||||
before_script:
|
||||
- apk add --no-cache lftp
|
||||
only:
|
||||
- main
|
||||
script:
|
||||
- lftp -c "set ftp:ssl-allow no; open -u $USERNAME,$PASSWORD $HOST;
|
||||
|
||||
mirror --reverse --delete --verbose --ignore-time --parallel=10 assets assets;
|
||||
mirror --reverse --delete --verbose --ignore-time --parallel=10 kirby kirby;
|
||||
mirror --reverse --delete --verbose --ignore-time --parallel=10 -x accounts/ -x cache/ -x sessions/ site site;
|
||||
mirror --reverse --delete --verbose --ignore-time --parallel=10 -x .git/ -x .gitlab-ci.yml vendor vendor;
|
||||
|
||||
quit"
|
||||
|
|
@ -17,9 +17,13 @@ tabs:
|
|||
label: Prix
|
||||
type: number
|
||||
after: €
|
||||
width: 1/3
|
||||
description:
|
||||
width: 1/4
|
||||
infos:
|
||||
type: writer
|
||||
nodes: false
|
||||
marks: false
|
||||
width: 2/3
|
||||
width: 3/4
|
||||
options:
|
||||
type: entries
|
||||
field:
|
||||
type: text
|
||||
|
|
|
|||
|
|
@ -13,6 +13,17 @@
|
|||
</title>
|
||||
|
||||
<script src="<?= url('assets/js/script.js') ?>"></script>
|
||||
|
||||
<script>
|
||||
window.SnipcartSettings = {
|
||||
publicApiKey: 'Y2QwMmJiZGItMDFiYi00MTg2LTg2ODItOWNlNTIyNGIzYWY5NjM4OTQ0ODU4NDY5NDcyNTU0',
|
||||
loadStrategy: 'on-user-interaction',
|
||||
modalStyle: "side",
|
||||
templatesUrl: "<?= url('assets/html/snipcart-templates.html') ?>",
|
||||
};
|
||||
|
||||
(()=>{var c,d;(d=(c=window.SnipcartSettings).version)!=null||(c.version="3.0");var s,S;(S=(s=window.SnipcartSettings).timeoutDuration)!=null||(s.timeoutDuration=2750);var l,p;(p=(l=window.SnipcartSettings).domain)!=null||(l.domain="cdn.snipcart.com");var w,u;(u=(w=window.SnipcartSettings).protocol)!=null||(w.protocol="https");var f=window.SnipcartSettings.version.includes("v3.0.0-ci")||window.SnipcartSettings.version!="3.0"&&window.SnipcartSettings.version.localeCompare("3.4.0",void 0,{numeric:!0,sensitivity:"base"})===-1,m=["focus","mouseover","touchmove","scroll","keydown"];window.LoadSnipcart=o;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r();function r(){window.SnipcartSettings.loadStrategy?window.SnipcartSettings.loadStrategy==="on-user-interaction"&&(m.forEach(t=>document.addEventListener(t,o)),setTimeout(o,window.SnipcartSettings.timeoutDuration)):o()}var a=!1;function o(){if(a)return;a=!0;let t=document.getElementsByTagName("head")[0],e=document.querySelector("#snipcart"),i=document.querySelector(`src[src^="${window.SnipcartSettings.protocol}://${window.SnipcartSettings.domain}"][src$="snipcart.js"]`),n=document.querySelector(`link[href^="${window.SnipcartSettings.protocol}://${window.SnipcartSettings.domain}"][href$="snipcart.css"]`);e||(e=document.createElement("div"),e.id="snipcart",e.setAttribute("hidden","true"),document.body.appendChild(e)),v(e),i||(i=document.createElement("script"),i.src=`${window.SnipcartSettings.protocol}://${window.SnipcartSettings.domain}/themes/v${window.SnipcartSettings.version}/default/snipcart.js`,i.async=!0,t.appendChild(i)),n||(n=document.createElement("link"),n.rel="stylesheet",n.type="text/css",n.href=`${window.SnipcartSettings.protocol}://${window.SnipcartSettings.domain}/themes/v${window.SnipcartSettings.version}/default/snipcart.css`,t.prepend(n)),m.forEach(g=>document.removeEventListener(g,o))}function v(t){!f||(t.dataset.apiKey=window.SnipcartSettings.publicApiKey,window.SnipcartSettings.addProductBehavior&&(t.dataset.configAddProductBehavior=window.SnipcartSettings.addProductBehavior),window.SnipcartSettings.modalStyle&&(t.dataset.configModalStyle=window.SnipcartSettings.modalStyle),window.SnipcartSettings.currency&&(t.dataset.currency=window.SnipcartSettings.currency),window.SnipcartSettings.templatesUrl&&(t.dataset.templatesUrl=window.SnipcartSettings.templatesUrl))}})();
|
||||
</script>
|
||||
</head>
|
||||
<body data-template="<?= $page->template() ?>">
|
||||
<?php snippet('nav') ?>
|
||||
|
|
|
|||
33
site/snippets/picture.php
Normal file
33
site/snippets/picture.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php if (isset($file)): ?>
|
||||
<?php
|
||||
$sizes = isset($size) ? '(min-width: 1085px) ' . $size . 'vw, 100vw' : '(min-width: 1085px) 50vw, 100vw';
|
||||
$alt = $file->alt() ?? '';
|
||||
$crop = $crop ?? false;
|
||||
|
||||
$webPSrcset = $file->srcset('webp');
|
||||
$srcset = $file->srcset();
|
||||
$src = $file->url();
|
||||
$width = $file->resize(1800)->width();
|
||||
$height = $file->resize(1800)->height();
|
||||
$class = isset($class) ? 'class="' . $class . '"': '';
|
||||
$lazy = $lazy ?? true;
|
||||
$span = isset($span) ? 'style="--span: ' . $span . ';"': '';
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<picture <?= $class ?> <?= $span ?> data-id="<?= $file->uuid() ?>" orientation="<?= $file->orientation() ?>">
|
||||
|
||||
<source srcset="<?= $webPSrcset ?>"
|
||||
sizes="<?= $sizes ?>" type="image/webp">
|
||||
<img
|
||||
src="<?= $src ?>"
|
||||
srcset="<?= $srcset ?>"
|
||||
sizes="<?= $sizes ?>"
|
||||
width="<?= $width ?>"
|
||||
height="<?= $height ?>"
|
||||
alt="<?= $alt?>"
|
||||
>
|
||||
<div class="loader"></div>
|
||||
</picture>
|
||||
<?php endif ?>
|
||||
42
site/templates/product.php
Normal file
42
site/templates/product.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php snippet('header') ?>
|
||||
<main>
|
||||
<section class="product-panel">
|
||||
<header>
|
||||
<h1><?= $page->title() ?></h1>
|
||||
<p><?= $page->price() ?></p>
|
||||
</header>
|
||||
|
||||
<div class="product-description">
|
||||
<?= $page->description() ?>
|
||||
</div>
|
||||
|
||||
<?php if ($page->options()->isNotEmpty()): ?>
|
||||
<div class="product-options">
|
||||
<?php foreach($page->options()->toEntries() as $option): ?>
|
||||
<label for="<?= $option ?>">
|
||||
<input type="checkbox" id="<?= $option ?>" name="<?= $option ?>"> <?= $option ?>
|
||||
</label>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<button
|
||||
class="snipcart-add-item"
|
||||
data-item-id="<?= $page->uri() ?>"
|
||||
data-item-price="<?= $page->price() ?>"
|
||||
data-item-description="<?= $page->infos() ?>"
|
||||
data-item-image="<?= $page->file()->url() ?>"
|
||||
data-item-name="<?= $page->title() ?>"
|
||||
>Ajouter au panier</button>
|
||||
</section>
|
||||
<section class="product-gallery">
|
||||
<?php foreach($page->files() as $image): ?>
|
||||
<figure>
|
||||
<?php snippet('picture', ['file' => $image,
|
||||
'size' => 40
|
||||
]) ?>
|
||||
</figure>
|
||||
<?php endforeach ?>
|
||||
</section>
|
||||
</main>
|
||||
<?php snippet('footer') ?>
|
||||
|
|
@ -153,7 +153,7 @@
|
|||
<?php endif ?>
|
||||
<p><?= $product->title() ?></p>
|
||||
<?= $product->description() ?>
|
||||
<a href="#" class="link-block" aria-hidden="true"></a>
|
||||
<a href="<?= $product->url() ?>" class="link-block" aria-hidden="true"></a>
|
||||
</article>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue