Skip to content

Commit

Permalink
ci(github): update actions
Browse files Browse the repository at this point in the history
[1] ────
Update '.github/workflow/*' for changes in code format to match Betarena standard.
  • Loading branch information
migbash committed Dec 10, 2024
1 parent 5003672 commit ee6edda
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 31 deletions.
41 changes: 13 additions & 28 deletions .github/workflows/pr.main.check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
- unlabeled
- synchronize

env:
DOCKER_IMAGE: 'scores_web'

jobs:

# ╭──────────────────────────────────────────────────────────────────╮
Expand All @@ -30,7 +27,7 @@ jobs:
# ╰──────────────────────────────────────────────────────────────────╯

npm-build-check:
name: 🪀 NPM Build Check
name: JOB /:/ NPM check build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
Expand All @@ -39,41 +36,30 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18.19.0
- name: '🏗️ Set npm version'
- name: 'STEP /:/ set npm version'
run: |
npm install -g [email protected]
- name: 'create .env'
- name: 'STEP /:/ create .env'
run: |
echo ${{ secrets.ENV_FILE }} | base64 -d > .env
- name: '🟩 Build npm'
cp ./env/.env.docker.file .env
- name: 'STEP /:/ build npm'
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
npm ci
npm run build
# docker-image-build:
# needs: npm-build-check
# name: 🐳 Docker Image Build
# runs-on: ubuntu-22.04
# steps:
# - uses: actions/checkout@v3
# - name: Build docker image
# run: |
# docker build . --file ./docker/prod.Dockerfile --tag ${{ env.DOCKER_IMAGE }}:$(date +%s)
#

# ╭──────────────────────────────────────────────────────────────────╮
# │ NOTE: │
# │ ➤ [2] check for correct PR Label │
# ╰──────────────────────────────────────────────────────────────────╯

check-labels:
name: 'Check PR Labels'
name: 'JOB /:/ PR check labels'
runs-on: ubuntu-22.04
steps:

- uses: actions/checkout@v3

- uses: mheap/github-action-required-labels@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -84,33 +70,31 @@ jobs:
semver:patch
semver:minor
semver:major
#

# ╭──────────────────────────────────────────────────────────────────────────────────╮
# │ 💠 │ JOB | PULL-REQUEST FORMAT │
# ╰──────────────────────────────────────────────────────────────────────────────────╯

pull-request-format:
name: 'JOB /:/ pr format'
runs-on: ubuntu-22.04
name: 'JOB :|: pr format'
steps:

- name: 'STEP :|: checkout source code'
- name: 'STEP /:/ checkout source code'
uses: actions/checkout@v4
with:
token: '${{ secrets.GH_TOKEN }}'
fetch-depth: 0
fetch-tags: true
ref: ${{ github.head_ref }}

- name: 'STEP :|: generate PR body'
- name: 'STEP /:/ generate PR body'
id: testing
run: |
git fetch origin main:main
echo "$(git branch | cat)"
echo "$(git branch --show-current)"
git log main.. --format=%B | cat > ./temp-pr-body.md
echo "$(cat ./temp-pr-body.md)"
# ╭─────
# │ NOTE:
# │ |: Not recommended for use
Expand All @@ -127,4 +111,5 @@ jobs:
body-template: null
# $(git log main.. --format=%B | cat)
body-update-action: 'replace'
body-uppercase-base-match: false
body-uppercase-base-match: false
#
3 changes: 1 addition & 2 deletions .github/workflows/pr.main.open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ jobs:
# ╰──────────────────────────────────────────────────────────────────╯

add_comment:
name: 'Add (PR) Comment'
name: 'JOB /:/ PR add comment'
runs-on: ubuntu-22.04
steps:

- uses: mshick/add-pr-comment@v1
with:
message: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.main.tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
# [🐞]
docker images
# [🐞]
docker images betarena-scores --format "{{.ID}}" --no-trunc --filter "label=project=Scores"
docker images betarena-scores --format "{{.ID}}" --no-trunc --filter "label=project=Scores"
echo "ENV_IMAGE_TAG_ID=$(docker images betarena-scores --format "{{.ID}}" --no-trunc --filter "label=project=Scores")" >> $GITHUB_ENV
- name: "STEP /:/ publish docker image"
run: |
Expand Down

0 comments on commit ee6edda

Please sign in to comment.