diff --git a/.gitea/workflows/build-deploy.yaml b/.gitea/workflows/build-deploy.yaml index 534f282..7f913b7 100644 --- a/.gitea/workflows/build-deploy.yaml +++ b/.gitea/workflows/build-deploy.yaml @@ -1,43 +1,42 @@ name: Gitea Actions - Hugo Deploy -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +run-name: ${{ gitea.actor }} is deploying Hugo 🚀 + on: - push: - branches: - - master + push: + branches: + - master + jobs: - Hugo-Deploy: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + Hugo-Deploy: + runs-on: ubuntu-latest - - name: Check out repository code - uses: actions/checkout@v4 - with: - submodules: true # Fetch Hugo themes (true OR recursive) - fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + steps: + - run: echo "🎉 Triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 Running on ${{ runner.os }}." - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: true + fetch-depth: 0 - - name: Setup Hugo - uses: peaceiris/actions-hugo@v3 - with: - hugo-version: "0.134.1" # or remove this for the latest - extended: true + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: "0.134.1" + extended: true - - name: List files in the repository - run: | - ls + - name: Build Hugo site + run: hugo --minify - - name: Build - run: hugo + - name: Deploy to Ubuntu server via SCP + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.DEPLOY_HOST }} + username: ${{ secrets.DEPLOY_USER }} + key: ${{ secrets.DEPLOY_KEY }} + source: "public/*" + target: "/var/www/www-hahmann-trier-de/" + strip_components: 1 - - name: Deploy - run: hugo deploy - env: - AWS_REGION: "ap-southeast-2" - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - - - run: echo "🍏 This job's status is ${{ job.status }}." + - run: echo "🍏 Deployment finished with status: ${{ job.status }}."