diff --git a/.forgejo/workflows/deploy.yaml b/.forgejo/workflows/deploy.yaml index 65befb1..9b6960d 100644 --- a/.forgejo/workflows/deploy.yaml +++ b/.forgejo/workflows/deploy.yaml @@ -33,13 +33,17 @@ jobs: with: fetch-depth: 0 # pull full history for page lastmod by git commit date + - name: Build website + uses: ./actions/build-website + - name: Build website - prod + if: (github.event_name == 'push' || github.event_name == 'schedule') && github.ref_name == 'main' run: | ./fetch-calendar.sh hugo - name: Build website - staging - if: github.ref_name != 'main' + if: github.event_name == 'pull_request' run: | sed -i "s#baseURL = 'https://hamburg.ccc.de/'#baseURL = 'https://staging.hamburg.ccc.de/pr${{ github.event.pull_request.number }}/'#" hugo.toml sed -i "s#index = true#index = false#" hugo.toml @@ -48,7 +52,6 @@ jobs: hugo --buildFuture - name: Deploy - Prepare keys - if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'schedule' run: | echo "${{ secrets.SSH_DEPLOY_KEY }}" > deploykey.priv chmod 400 deploykey.priv diff --git a/actions/build-website/action.yml b/actions/build-website/action.yml new file mode 100644 index 0000000..ce06591 --- /dev/null +++ b/actions/build-website/action.yml @@ -0,0 +1,7 @@ +name: Build Website +description: Build Website Test + +runs: + using: docker + image: hugomods/hugo:exts-0.148.1 +