chore: Refactor code and update GitHub workflow

- Remove comment section from the Footer component in Footer.js
- Add environment variable `SHORT_SHA` to store the first 8 characters of the commit SHA in ci.yml file
- Remove the addition of `SHORT_SHA` to the `GITHUB_ENV` file in ci.yml file
This commit is contained in:
Laisky.Cai 2023-11-17 02:16:17 +00:00
parent 91d5003c61
commit 8d270c8c9a
2 changed files with 6 additions and 11 deletions

View File

@ -5,6 +5,9 @@ on:
branches: branches:
- 'main' - 'main'
env:
SHORT_SHA: "${GITHUB_SHA} | cut -c1-8`"
jobs: jobs:
docker: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -46,8 +49,8 @@ jobs:
path: ${{ steps.go-cache-paths.outputs.go-mod }} path: ${{ steps.go-cache-paths.outputs.go-mod }}
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
- name: Add SHORT_SHA env property with commit short sha # - name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV # run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- -
name: Build and push latest name: Build and push latest
@ -62,4 +65,4 @@ jobs:
with: with:
context: . context: .
push: true push: true
tags: ppcelery/one-api:${SHORT_SHA} tags: ppcelery/one-api:${{ env.SHORT_SHA }}

View File

@ -43,14 +43,6 @@ const Footer = () => {
> >
{systemName} {process.env.REACT_APP_VERSION}{' '} {systemName} {process.env.REACT_APP_VERSION}{' '}
</a> </a>
{' '}
<a href='https://github.com/songquanpeng' target='_blank'>
JustSong
</a>{' '}
构建源代码遵循{' '}
<a href='https://opensource.org/licenses/mit-license.php'>
MIT 协议
</a>
</div> </div>
)} )}
</Container> </Container>