Skip to content

Show servicebody dropdown by defautl as well as all filters (#1141) #907

Show servicebody dropdown by defautl as well as all filters (#1141)

Show servicebody dropdown by defautl as well as all filters (#1141) #907

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.1"
- "8.2"
- "8.3"
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@v4
- name: php ${{ matrix.php }} 🐘
id: setup-php
uses: shivammathur/setup-php@2.30.4
with:
php-version: ${{ matrix.php }}
tools: composer:v2.6.5
- 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@v4.4.1
with:
files: src/coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
test-js:
runs-on: ubuntu-22.04
steps:
- name: checkout 🛒
uses: actions/checkout@v4
- name: node 20 ❇️
uses: actions/setup-node@v4.0.2
with:
node-version: 20
- name: make npm ♦️
run: |
make npm
- name: make lint-js 🧹
env:
LARAVEL_BYPASS_ENV_CHECK: '1'
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@v4
- name: php 8.1 🐘
id: setup-php
uses: shivammathur/setup-php@2.30.4
with:
php-version: '8.1'
tools: composer:v2.6.5
- name: make composer 🎼
run: |
make composer
- name: setup node 20 ❇️
uses: actions/setup-node@v4.0.2
with:
node-version: 20
- 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@v4
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@v4
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@v3
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|rc) ]]; then echo "true"; else echo "false"; fi)
echo "RELEASE_TYPE=${RELEASE_TYPE}" >> $GITHUB_ENV
- name: Create Release 🎉
uses: ncipollo/release-action@v1.14.0
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@v4
- name: Configure AWS Credentials 🪪
uses: aws-actions/configure-aws-credentials@v4
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 }}