diff --git a/.gitea/workflows/build_and_deploy.yml b/.gitea/workflows/build_and_deploy.yml new file mode 100644 index 0000000..412e31a --- /dev/null +++ b/.gitea/workflows/build_and_deploy.yml @@ -0,0 +1,28 @@ +name: Build and deploy website +defaults: + run: + shell: sh +on: + push: + branches: + - master + + +jobs: + Build-and-deploy: + runs-on: alpine + steps: + - name: Install dependencies + run: | + apk add git openssh rsync + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - name: Deploy website using rsync + run: | + eval $(ssh-agent -s) + echo "${{ secrets.SSH_PRIVATE_KEY }}" | tr -d '\r' | ssh-add - + mkdir -p ~/.ssh + chmod 700 ~/.ssh + rsync -e "ssh -o StrictHostKeyChecking=no -p ${{ secrets.SSH_PORT }}" -rvz ./src/ ${{ secrets.SSH_DESTINATION }}:/var/www/louis-vallat.dev/ --delete diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 2832e3f..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,20 +0,0 @@ -image: alpine - -variables: - GIT_SUBMODULE_STRATEGY: recursive - -stages: - - deploy - -deploy: - stage: deploy - before_script: - - apk add openssh zola rsync - - eval $(ssh-agent -s) - - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - - - mkdir -p ~/.ssh - - chmod 700 ~/.ssh - script: - - rsync -e "ssh -o StrictHostKeyChecking=no -p $SSH_PORT" -rvz ./src/ $SSH_DESTINATION:/var/www/louis-vallat.dev/ --delete - only: - - master