0.1.5 #47
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docker Image CI | |
| on: | |
| push: | |
| tags: | |
| - '*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Get Version from package.json | |
| id: get_version | |
| run: | | |
| VERSION=$(node -p 'require("./package.json").version') | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ env.VERSION }} | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # 登录 Docker Hub | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| # 构建并推送镜像 | |
| - name: Build and Push Docker Image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| platforms: | | |
| linux/amd64 | |
| push: true | |
| tags: | | |
| ${{ secrets.DOCKERHUB_USERNAME }}/nekorify:web-latest | |
| ${{ secrets.DOCKERHUB_USERNAME }}/nekorify:web-${{ env.VERSION }} | |
| - name: Push Summary | |
| run: echo "### Build ${{ secrets.DOCKERHUB_USERNAME }}/nekorify:web-${{ env.VERSION }} Successfully :rocket:" >> $GITHUB_STEP_SUMMARY |