Use repository permissions and branch pushes for CI [skip ci]

This commit is contained in:
Andras Schmelczer 2026-11-11 21:38:33 +00:00
commit c227e0f4de

View file

@ -2,18 +2,13 @@ name: Check & deploy
'on': 'on':
push: push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch: workflow_dispatch:
jobs: jobs:
deploy: deploy:
runs-on: ${{ (github.actor == 'renovate-bot' || github.event.pull_request.user.login == 'renovate-bot' || startsWith(github.ref, 'refs/heads/renovate/') || startsWith(github.head_ref, runs-on: docker
'renovate/')) && 'renovate' || 'docker' }}
steps: steps:
- uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262 - uses: https://github.com/actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with: with:
persist-credentials: false persist-credentials: false
- name: Stage static files - name: Stage static files
@ -21,14 +16,11 @@ jobs:
run: | run: |
mkdir -p _site mkdir -p _site
cp -R index.html css js _site/ cp -R index.html css js _site/
- name: Upload static site artifact 1 - name: Upload static site artifact 1
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') }} if: ${{ github.ref == 'refs/heads/main' }}
uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 uses: https://github.com/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
with: with:
name: pages-deploy-0 name: pages-deploy-0
path: _site path: _site
if-no-files-found: error if-no-files-found: error
retention-days: 1 retention-days: 1
if: ${{ contains(fromJSON('["andras","ruby336688","renovate-bot"]'), github.actor) && (!github.event.pull_request || contains(fromJSON('["andras","ruby336688","renovate-bot"]'),
github.event.pull_request.user.login)) }}