From 6db3438045581ad2bacd1e368a5ff6fb6ca3988d Mon Sep 17 00:00:00 2001 From: Lino Date: Sun, 19 Nov 2023 19:04:16 +0100 Subject: [PATCH] Add dev deployment --- .github/workflows/deploy-dev.yml | 38 +++++++++++++++++++ .../workflows/{deploy.yml => deploy-prod.yml} | 4 +- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy-dev.yml rename .github/workflows/{deploy.yml => deploy-prod.yml} (93%) diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml new file mode 100644 index 0000000..2837ca8 --- /dev/null +++ b/.github/workflows/deploy-dev.yml @@ -0,0 +1,38 @@ +name: Deploy website to dev server + +on: + push: + branches-ignore: + - main + pull_request: + branches-ignore: + - main + +jobs: + deploy: + runs-on: ubuntu-22.04 + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v4 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: '0.119.0' + extended: true + + - name: Build + run: hugo --minify -b https://dev.ff.berlin --destination dev/$GITHUB_REF_NAME + + - name: Deploy + uses: appleboy/scp-action@master + with: + host: ${{ secrets.PRODUCTION_SERVER }} + username: ${{ secrets.PRODUCTION_USERNAME }} + key: ${{ secrets.PRODUCTION_SSH_KEY }} + source: "dev/$GITHUB_REF_NAME" + target: "/var/www/berlin.freifunk.net/www/" \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy-prod.yml similarity index 93% rename from .github/workflows/deploy.yml rename to .github/workflows/deploy-prod.yml index d303d3b..d91b664 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy-prod.yml @@ -1,9 +1,9 @@ -name: Deploy Website +name: Deploy website to production server on: push: branches: - - hugo # Set a branch to deploy + - main pull_request: jobs: