Skip to content

Added zipcode and birthdate to event signup export (issue #300) #332

Added zipcode and birthdate to event signup export (issue #300)

Added zipcode and birthdate to event signup export (issue #300) #332

Workflow file for this run

name: Build, Test & Deploy
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
env:
DB_DATABASE: esac
DB_USERNAME: mysql
DB_PASSWORD: mysql
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}
jobs:
tests:
name: Build front-end & run tests
runs-on: ubuntu-latest
environment: Build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache PHP dependencies
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache Node dependencies
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
- name: Setup MySQL
uses: mirromutth/[email protected]
with:
host port: 3306
container port: 3306
mysql version: 8.0
mysql database: ${{ env.DB_DATABASE }}
mysql user: ${{ env.DB_USERNAME }}
mysql password: ${{ env.DB_PASSWORD }}
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: |
composer install --prefer-dist --no-progress --no-suggest
npm ci
- name: PHP artisan setup
run: |
php artisan key:generate
php artisan storage:link
php artisan migrate --seed
php artisan serve &
- name: NPM build
run: npm run prod
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.xml
- name: Upload to Codecov
uses: codecov/codecov-action@v3
if: env.HAS_CODECOV_TOKEN
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: true
publish:
name: Build and push Docker image
runs-on: ubuntu-latest
environment: Build
needs: tests
if: github.secret_source == 'Actions' || github.secret_source == 'Dependabot'
steps:
- name: Docker Login
uses: docker/login-action@v3
with:
username: esacci
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: esac/website:${{ github.run_number }}
deploy:
name: Deploy to production
runs-on: ubuntu-latest
needs: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Deploy via SSH
uses: D3rHase/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
user: ic
private_key: ${{ secrets.SSH_PRIVATE_KEY }}
command: ./update.sh website "${{ github.run_number }}" "${{ github.actor }}" "${{ github.event.head_commit.message }}" "${{ github.event.head_commit.timestamp }}" "${{ github.ref }}"