mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-17 17:50:43 +08:00
🔧 工作流验证
This commit is contained in:
parent
018912c380
commit
1b27d1999f
11
.github/workflows/docker-build.yml
vendored
11
.github/workflows/docker-build.yml
vendored
@ -24,20 +24,23 @@ jobs:
|
|||||||
|
|
||||||
- name: Get version from package.json
|
- name: Get version from package.json
|
||||||
id: get_version
|
id: get_version
|
||||||
run: echo "VERSION=$(node -p \"require('./package.json').version\")" >> $GITHUB_ENV
|
run: echo "VERSION=$(node -p \"require(\\\"./package.json\\\").version\")" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Print version
|
||||||
|
run: echo "Version is $VERSION"
|
||||||
|
|
||||||
- name: Build project
|
- name: Build project
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
run: |
|
run: |
|
||||||
docker build -t ghcr.io/${{ github.repository }}/nazhua:${{ env.VERSION }} .
|
docker build -t ghcr.io/${{ github.repository }}/nazhua:$VERSION .
|
||||||
|
|
||||||
- name: Log in to GitHub Container Registry
|
- name: Log in to GitHub Container Registry
|
||||||
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||||
|
|
||||||
- name: Push Docker image
|
- name: Push Docker image
|
||||||
run: |
|
run: |
|
||||||
docker push ghcr.io/${{ github.repository }}/nazhua:${{ env.VERSION }}
|
docker push ghcr.io/${{ github.repository }}/nazhua:$VERSION
|
||||||
docker tag ghcr.io/${{ github.repository }}/nazhua:${{ env.VERSION }} ghcr.io/${{ github.repository }}/nazhua:latest
|
docker tag ghcr.io/${{ github.repository }}/nazhua:$VERSION ghcr.io/${{ github.repository }}/nazhua:latest
|
||||||
docker push ghcr.io/${{ github.repository }}/nazhua:latest
|
docker push ghcr.io/${{ github.repository }}/nazhua:latest
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user