ci: make step conditions more structured
Either have a step always be executed, be executed for prod or be executed for a PR (staging) and use the same conditions for each of these cases.
This commit is contained in:
parent
f9f3a82f23
commit
cb089a6d05
1 changed files with 2 additions and 2 deletions
|
@ -39,12 +39,13 @@ jobs:
|
|||
fetch-depth: 0 # pull full history for page lastmod by git commit date
|
||||
|
||||
- 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
|
||||
|
@ -53,7 +54,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue