Skip to content

Allow for using a comma seperated string with weekdays filter for Get… #634

Allow for using a comma seperated string with weekdays filter for Get…

Allow for using a comma seperated string with weekdays filter for Get… #634

Workflow file for this run

name: main
on:
push:
branches: ['main']
tags: ['*']
env:
IMAGE_NAME: bmltenabled/bmlt-root-server:latest
jobs:
test-php:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
db:
- "10.2"
- "latest"
services:
mariadb:
image: mariadb:${{ matrix.db }}
ports:
- 3306
env:
MARIADB_USER: rootserver
MARIADB_PASSWORD: rootserver
MARIADB_DATABASE: rootserver
MARIADB_ROOT_PASSWORD: rootserver
options: --health-cmd="${{ (matrix.db == 'latest') && 'mariadb-admin' || 'mysqladmin' }} ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: checkout 🛒
uses: actions/checkout@v3
- name: php ${{ matrix.php }} 🐘
id: setup-php
uses: shivammathur/setup-php@2.22.0
with:
php-version: ${{ matrix.php }}
tools: composer:v2.4.1
- name: make composer 🎼
run: |
DEV=1 make composer
- name: make lint 🧹
run: |
make lint
- name: make test 🧪
env:
DB_PORT: ${{ job.services.mariadb.ports[3306] }}
run: |
make test
- name: Send coverage data to codecov.io 📀
if: matrix.db == 'latest' && matrix.php == '8.1'
uses: codecov/codecov-action@v3.1.1
with:
files: src/coverage.xml
test-js:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
steps:
- name: checkout 🛒
uses: actions/checkout@v3
- name: node 16 ❇️
uses: actions/setup-node@v3.5.1
with:
node-version: 16
- name: make npm ♦️
run: |
make npm
- name: make lint-js 🧹
run: |
make lint-js
- name: make test-js 🧪
env:
LARAVEL_BYPASS_ENV_CHECK: '1'
run: |
make test-js
build:
runs-on: ubuntu-22.04
needs: [test-php, test-js]
permissions:
id-token: write
contents: write
steps:
- name: Checkout 🛒
uses: actions/checkout@v3
- name: php 8.0 🐘
id: setup-php
uses: shivammathur/setup-php@2.22.0
with:
php-version: '8.0'
tools: composer:v2.4.1
- name: make composer 🎼
run: |
make composer
- name: setup node 16 ❇️
uses: actions/setup-node@v3.5.1
with:
node-version: 16
- name: make frontend 🐥
run: |
make frontend
- name: make crouton 🍞
run: |
make crouton
- name: Write .env with APP_VERSION and COMMIT_SHA 🧃
shell: bash
run: |
echo COMMIT_SHA=${GITHUB_SHA} > src/.env
if [[ $GITHUB_REF_NAME =~ ^([0-9]+\.){2}(\*|[0-9]+)(-.*)?$ ]]; then
echo APP_VERSION=${GITHUB_REF_NAME} >> src/.env
fi
- name: make zip 🗜
run: |
make zip
- name: Configure S3 AWS Credentials 🪪
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-s3-artifact
role-session-name: gh-actions
aws-region: us-east-1
- name: Copy Artifacts to S3 🪣
run: |
aws s3 cp build/bmlt-root-server.zip s3://${{ secrets.S3_BUCKET }}/bmlt-root-server/bmlt-root-server-$(cat src/config/app.php | grep "'version'" | cut -d"'" -f6)-build${GITHUB_RUN_NUMBER}-${GITHUB_SHA}.zip
- name: Configure AWS Credentials 🪪
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-tf-bmlt-rs
role-session-name: gh-actions-bmlt
aws-region: us-east-1
- name: Login to Docker Hub 🎫
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: make docker 🐳
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
run: |
make docker
- name: make docker-push 🐋
if: contains(github.ref_name, 'main') || contains(github.ref_name, 'unstable')
id: docker_push_images
run: |
make docker-push
- name: Generate Release Notes 📝
if: github.ref_type == 'tag'
run: |
curl -LO https://raw.githubusercontent.com/bmlt-enabled/release-notes-tool/master/gh-release-notes.sh
chmod +x gh-release-notes.sh
./gh-release-notes.sh CHANGELOG.md "##"
RELEASE_TYPE=$(if [[ "$GITHUB_REF_NAME" =~ "beta" ]]; then echo "true"; else echo "false"; fi)
echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_ENV
- name: Create Release 🎉
uses: ncipollo/release-action@v1.11.1
if: github.ref_type == 'tag'
with:
artifacts: "build/bmlt-root-server.zip"
bodyFile: "changelog.txt"
prerelease: ${{ env.RELEASE_TYPE }}
deploy:
runs-on: ubuntu-22.04
concurrency: deploy-${{ matrix.env }}
needs: [build]
permissions:
id-token: write
contents: write
if: contains(github.ref_name, 'main')
strategy:
fail-fast: false
matrix:
env:
- "latest"
- "unstable"
steps:
- name: Checkout 🛒
uses: actions/checkout@v3
- name: Configure AWS Credentials 🪪
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/github-actions/gh-ci-tf-bmlt-rs
role-session-name: gh-actions-bmlt
aws-region: us-east-1
- name: Update ECS Service bmlt-${{ matrix.env }} ⛴
run: |
aws ecs update-service --cluster bmlt --service bmlt-${{ matrix.env }} --force-new-deployment
aws ecs wait services-stable --cluster bmlt --services bmlt-${{ matrix.env }}