Skip to content

Commit

Permalink
Merge pull request #705 from DoomHEADSHOT/development
Browse files Browse the repository at this point in the history
fix: trigger github actions on pull requests
  • Loading branch information
elpiel authored Jul 19, 2024
2 parents 118b172 + 075c415 commit fc6b184
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Build

on: [push]
on:
- push
- pull_request

# Stops the running workflow of previous pushes
concurrency:
Expand Down Expand Up @@ -80,39 +82,49 @@ jobs:
run: npm ci

- name: Build (release)
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web
run: npm run build

# create folder for release and dev builds to be published on GH pages
- run: mkdir -p ./build/dev
# if merge request, the ref_name will be e.g. `705/merge`
# so we need to recursively create these 2 folders
# create folder for release and dev builds to be published on GH pages
- run: mkdir -p ./build/${{ github.ref_name }}/dev
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web

- name: Package (release)
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web
run: npm pack

- name: Copy release package archive
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web
run: cp ./*.tgz ./build
run: cp ./*.tgz ./build/${{ github.ref_name }}

- name: Build (dev)
working-directory: stremio-core-web
run: npm run build-dev

- name: Package (dev)
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web
run: npm pack

- name: Copy dev package archive
if: ${{ ! startsWith(github.ref, 'refs/pull/') }}
working-directory: stremio-core-web
run: cp ./*.tgz ./build/dev
run: cp ./*.tgz ./build/${{ github.ref_name }}/dev

- name: Deploy gh-pages
if: ${{ ! startsWith(github.ref, 'refs/pull/') && github.actor != 'dependabot[bot]' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# the build directory already contains the `github.ref_name` as subfolder(s)
publish_dir: ./stremio-core-web/build
# in stremio, we use `feat/features-name` or `fix/this-bug`
# so we need a recursive creation of the destination dir
destination_dir: ./stremio-core-web/${{ github.ref_name }}
# so we need a recursive creation of the destination dir!
destination_dir: ./stremio-core-web/
allow_empty_commit: true

0 comments on commit fc6b184

Please sign in to comment.