From a6dc11fd95822b227488fc88ea54a494376c59f6 Mon Sep 17 00:00:00 2001 From: Drew Date: Wed, 16 Apr 2025 09:18:12 -0600 Subject: [PATCH] adds gitlab ci --- .gitea/workflows/deploy.yaml | 57 ------------------------------------ .gitlab-ci.yml | 22 ++++++++++++++ 2 files changed, 22 insertions(+), 57 deletions(-) delete mode 100644 .gitea/workflows/deploy.yaml create mode 100644 .gitlab-ci.yml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml deleted file mode 100644 index 796b9d7..0000000 --- a/.gitea/workflows/deploy.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Deploy Hugo Site - -on: - push: - branches: - - deploy - -jobs: - build-and-deploy: - runs-on: 'ubuntu-latest' - container: - image: klakegg/hugo:ext - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 1 - submodules: recursive # Important if you're using Hugo modules or themes as submodules - - - name: Show Hugo version - run: hugo version - - - name: Build site with Hugo - run: | - hugo --minify --gc --cleanDestinationDir - echo "Build completed. Public directory contents:" - ls -la public/ - env: - HUGO_ENV: production - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - - - name: Install Surfer - run: | - npm install -g cloudron-surfer - surfer --version - - - name: Deploy to Surfer - run: | - echo "Deploying to: ${{ secrets.SURFER_SERVER }}" - # Create a tar archive for more reliable transfer - tar -czf deploy.tar.gz -C public . - - # Deploy using Surfer - surfer put --token ${{ secrets.SURFER_TOKEN }} \ - --server ${{ secrets.SURFER_SERVER }} \ - deploy.tar.gz /tmp/deploy.tar.gz - - # Extract on remote server - surfer exec --token ${{ secrets.SURFER_TOKEN }} \ - --server ${{ secrets.SURFER_SERVER }} \ - "tar -xzf /tmp/deploy.tar.gz -C / && rm /tmp/deploy.tar.gz" - - echo "Deployment completed successfully" \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..1d3532e --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,22 @@ +image: klakegg/hugo:ext + +variables: + HUGO_ENV: production + +deploy: + stage: deploy + image: node:18 + only: + - deploy + before_script: + - npm install -g cloudron-surfer + script: + - hugo version + - hugo --minify --gc --cleanDestinationDir + - echo "Build completed. Public directory contents:" + - ls -la public/ + - echo "Deploying to: $SURFER_SERVER" + - tar -czf deploy.tar.gz -C public . + - surfer put --token $SURFER_TOKEN --server $SURFER_SERVER deploy.tar.gz /tmp/deploy.tar.gz + - surfer exec --token $SURFER_TOKEN --server $SURFER_SERVER "tar -xzf /tmp/deploy.tar.gz -C / && rm /tmp/deploy.tar.gz" + - echo "Deployment completed successfully"