Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create PR workflow using GitHub Actions #447

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deploy to Pages

on:
push:
branches: [ "master" ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build docker image
run: docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) web
- name: Install composer dependencies
run: docker-compose run --rm -T web composer install --no-interaction --no-progress
- name: Tests
run: docker-compose run --rm -T web ./vendor/bin/phpunit tests/
- name: Install node dependencies
run: docker-compose run --rm -T web yarn install
- name: Build
run: docker-compose run --rm -T web yarn production
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: './build_production/'
branch: gh-pages
clean-exclude: pr-preview
40 changes: 40 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests and Preview

on:
pull_request:
types:
- opened
- reopened
- synchronize
- closed

concurrency:
group: preview-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Build docker image
run: docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) web

- name: Install composer dependencies
run: docker-compose run --rm -T web composer install --no-interaction --no-progress

- name: Tests
run: docker-compose run --rm -T web ./vendor/bin/phpunit tests/

- name: Install node dependencies
run: docker-compose run --rm -T web yarn install

- name: Build
run: docker-compose run --rm -T web yarn production

- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build_production/