Skip to content

Commit

Permalink
feat: github actions 打包发布
Browse files Browse the repository at this point in the history
  • Loading branch information
HoPGoldy committed Nov 13, 2023
1 parent a8869ea commit 0997a5d
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 32 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/npm-publish.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release

on:
push:
tags:
- '*'

jobs:
build-publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- run: yarn install
- run: yarn run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

build-publish-docker:
needs: build-publish-npm
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Get Version
uses: rexdefuror/[email protected]

- name: Check docker version
run: docker -v

- name: Build the Docker image
run: docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/cube-diary:${{ env.PACKAGE_VERSION }} .

- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push the Docker image
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/cube-diary:${{ env.PACKAGE_VERSION }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cube-diary",
"version": "1.0.2",
"version": "1.0.3",
"main": "index.js",
"repository": "[email protected]:HoPGoldy/cube-diary.git",
"author": "HoPGoldy <[email protected]>",
Expand Down

0 comments on commit 0997a5d

Please sign in to comment.