Deploy static website from git

Just wondering if there is a way to deploy a website build in vanilla HTML, CSS and JS which I version control on a Forgejo instance (this might not be relevant though)?

Asking this because I found out Forgejo doesn’t have a straightforward equivalent of GitHub Pages, so I was wondering if it would be easier done with Yunodhost.

Yes cf Installing "custom" apps | Yunohost Documentation you can use my webapp : YunoHost app store | My Webapp

It doesn’t integrate with git though so you’d have to manually git clone / git pull the repo from the command line … but oneday™ we may add a button to run a git pull from the webadmin directly

1 Like

Oh, I see. Thank you.
Is this a YH homemade app? :stuck_out_tongue:

yes it’s just a “skeleton” app which configures the small technical bits like nginx and ssowat conf and then you just put your own files

1 Like

I host source code of static website on Github and I build and deploy it using Github Actions to my server running Yunohost and My WebApp app. Same can be done using Forgejo.

1 Like

Bonjour,
Faut-il quand même installer WebApp ? Pour ma part je souhaite juste installer le paquet Gitlab de yunohost sans installer WebApp est-ce que cela va fonctionner ?
En vous remerciant pour vos réponses.

Hello,
Do I still need to install WebApp? For my part, I just want to install the Gitlab package from yunohost without installing WebApp. Will that work?
Thank you for your answers.

Can you tell me more about this please? Feel free to DM if you prefer, although I don’t think should be a problem if we keep posting here.

Hi.
I have Simple Github Action workflow which builds website from source code hosted on Github and sends ready to use files via SCP (SSH) to my server.

name: Deploy_web

env:
  DESTINATION_DIRECTORY: ${{ secrets.DESTINATION_DIRECTORY }}

on:
  push:
    branches:
      - master

jobs:
  deploy:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Install SSH keysudo 
      run: |
        mkdir ~/.ssh && touch ~/.ssh/id_rsa
        echo "${{ secrets.RSA_KEY }}" > ~/.ssh/id_rsa && chmod 400 ~/.ssh/id_rsa

    - name: Install Hugo
      run: |
        echo "Building using Docker"

    - name: Build Hugo website
      run: |
        git submodule init
        git submodule update
        docker run -v $(pwd):/src -p 1313:1313 jakejarvis/hugo-extended:latest
        echo "Built using Docker version of Hugo"

    - name: Deploy website
      run: |
        ssh -o StrictHostKeyChecking=no -p ${{ secrets.PORT }} ${{ secrets.USERNAME }}@${{ secrets.HOST }}
        scp -P ${{ secrets.PORT }} -r public/* ${{ secrets.USERNAME }}@${{ secrets.HOST }}:$DESTINATION_DIRECTORY

For me it is the easiest way to quickly edit, test and deploy website and still keeping everything as a Code.

2 Likes

Thank you very much for sharing this.