mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:50:42 +00:00
Update workflow files (#675)
## Description: - Split the CI workflow in to separate build and test jobs, to improve visibility on PRs when the build passes but tests fail. - Add emoji labels to various jobs and steps - Add build and startup time to job summary    ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
name: CI
|
||||
name: 🧪 CI
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
build:
|
||||
@@ -12,13 +12,22 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Setup npm
|
||||
run: npm install
|
||||
- name: Run tests
|
||||
run: npm test
|
||||
- name: Build
|
||||
run: npm run build-prod
|
||||
- run: npm ci
|
||||
- run: npm run build-prod
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
path: out/index.html
|
||||
retention-days: 1
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: false
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
- run: npm ci
|
||||
- run: npm test
|
||||
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
SUBDOMAIN: ${{ github.event_name == 'push' && github.ref_name || inputs.target_subdomain || 'main' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Update deployment status
|
||||
- name: 📝 Update deployment status
|
||||
env:
|
||||
FQDN: ${{ env.SUBDOMAIN && format('{0}.{1}', env.SUBDOMAIN, env.DOMAIN) || env.DOMAIN || 'openfront.dev' }}
|
||||
run: |
|
||||
@@ -71,12 +71,12 @@ jobs:
|
||||
|
||||
Deploying from $GITHUB_REF to $FQDN
|
||||
EOF
|
||||
- name: Log in to Docker Hub
|
||||
- name: 🔗 Log in to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ vars.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Create SSH private key
|
||||
- name: 🔑 Create SSH private key
|
||||
env:
|
||||
SERVER_HOST_EU: ${{ secrets.SERVER_HOST_EU }}
|
||||
SERVER_HOST_STAGING: ${{ secrets.SERVER_HOST_STAGING }}
|
||||
@@ -90,7 +90,7 @@ jobs:
|
||||
test -n "$SERVER_HOST_US" && ssh-keyscan -H "$SERVER_HOST_US" >> ~/.ssh/known_hosts
|
||||
test -n "$SERVER_HOST_EU" && ssh-keyscan -H "$SERVER_HOST_EU" >> ~/.ssh/known_hosts
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
- name: Deploy
|
||||
- name: 🚢 Deploy
|
||||
env:
|
||||
ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}
|
||||
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
@@ -115,8 +115,9 @@ jobs:
|
||||
run: |
|
||||
echo "::group::deploy.sh"
|
||||
./deploy.sh "$ENV" "$HOST" "$SUBDOMAIN"
|
||||
echo "Deployment created in ${SECONDS} seconds" >> $GITHUB_STEP_SUMMARY
|
||||
echo "::endgroup::"
|
||||
- name: Wait for deployment to start
|
||||
- name: ⏳ Wait for deployment to start
|
||||
run: |
|
||||
echo "::group::Wait for deployment to start"
|
||||
set -euxo pipefail
|
||||
@@ -127,8 +128,9 @@ jobs:
|
||||
fi
|
||||
sleep 10
|
||||
done
|
||||
echo "Deployment started in ${SECONDS} seconds" >> $GITHUB_STEP_SUMMARY
|
||||
echo "::endgroup::"
|
||||
- name: Notify PR 🚀
|
||||
- name: 🚀 Notify PR
|
||||
if: ${{ success() && github.event_name == 'push'
|
||||
&& github.repository != 'openfrontio/OpenFrontIO'
|
||||
}}
|
||||
@@ -147,7 +149,7 @@ jobs:
|
||||
exit 0;
|
||||
fi
|
||||
gh pr comment "$pr_url" --body "🚀 Deployed ${GITHUB_SHA} to [$FQDN](https://$FQDN)."
|
||||
- name: Update deployment status ✅
|
||||
- name: ✅ Update deployment status
|
||||
if: success()
|
||||
run: |
|
||||
cat <<EOF >> $GITHUB_STEP_SUMMARY
|
||||
@@ -155,7 +157,7 @@ jobs:
|
||||
|
||||
Deployed from $GITHUB_REF to $FQDN
|
||||
EOF
|
||||
- name: Update deployment status ❌
|
||||
- name: ❌ Update deployment status
|
||||
if: failure()
|
||||
run: |
|
||||
cat <<EOF >> $GITHUB_STEP_SUMMARY
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: ESLint Check
|
||||
name: 🔍 ESLint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Prettier Check
|
||||
name: 🎨 Prettier
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
Reference in New Issue
Block a user