diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 076493044..8e3954117 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 3eb00042d..836b8ec33 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -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 <> $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 <> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 3cd72b90e..836b8284d 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -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 diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 530ef7fcf..315b8031b 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -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