Use repository permissions and branch pushes for CI [skip ci]
This commit is contained in:
parent
c38f46f697
commit
e2250d3546
1 changed files with 2 additions and 14 deletions
|
|
@ -2,15 +2,11 @@ name: Build & deploy web version
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['main']
|
|
||||||
pull_request:
|
|
||||||
branches: ['main']
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Build WebAssembly & deploy
|
name: Build WebAssembly & 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' }}
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
# Keep in sync with the version table in README.md.
|
# Keep in sync with the version table in README.md.
|
||||||
|
|
@ -18,7 +14,6 @@ jobs:
|
||||||
|
|
||||||
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: Install cmake & friends
|
- name: Install cmake & friends
|
||||||
|
|
@ -30,7 +25,6 @@ jobs:
|
||||||
$SUDO apt-get install -y --no-install-recommends \
|
$SUDO apt-get install -y --no-install-recommends \
|
||||||
ca-certificates cmake git ninja-build python3 xz-utils
|
ca-certificates cmake git ninja-build python3 xz-utils
|
||||||
cmake --version
|
cmake --version
|
||||||
|
|
||||||
- name: Install Emscripten
|
- name: Install Emscripten
|
||||||
run: |
|
run: |
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
@ -47,27 +41,21 @@ jobs:
|
||||||
echo "EM_CONFIG=${EM_CONFIG:-$EMSDK/.emscripten}"
|
echo "EM_CONFIG=${EM_CONFIG:-$EMSDK/.emscripten}"
|
||||||
echo "PATH=$PATH"
|
echo "PATH=$PATH"
|
||||||
} >> "$GITHUB_ENV"
|
} >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- name: Configure
|
- name: Configure
|
||||||
run: emcmake cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Release
|
run: emcmake cmake -S . -B build-web -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build build-web
|
run: cmake --build build-web
|
||||||
|
|
||||||
- name: Check the expected files were produced
|
- name: Check the expected files were produced
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
for file in index.html index.js index.wasm index.data; do
|
for file in index.html index.js index.wasm index.data; do
|
||||||
test -s "build-web/web/$file" || { echo "hiányzik: $file"; exit 1; }
|
test -s "build-web/web/$file" || { echo "hiányzik: $file"; exit 1; }
|
||||||
done
|
done
|
||||||
|
|
||||||
- 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: build-web/web
|
path: build-web/web
|
||||||
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)) }}
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue