diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..b43fb97 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: release + +on: + push: + tags: + - v* + +jobs: + push_to_registry: + name: Push Docker image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Docker Login + uses: docker/login-action@v2.0.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v3.1.1 + with: + context: . + push: true + tags: ${{ secrets.DOCKER_TAG }} diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 52% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 0c3ba9f..bff272d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: CI +name: test env: NODE_OPTIONS: --max-old-space-size=6144 @@ -34,23 +34,3 @@ jobs: - name: Test run: pnpm run test - - push_to_registry: - name: Push Docker image to Docker Hub - runs-on: ubuntu-latest - steps: - - name: Check out the repo - uses: actions/checkout@v3 - - - name: Docker Login - uses: docker/login-action@v2.0.0 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - uses: docker/build-push-action@v3.1.1 - with: - context: . - push: true - tags: ${{ secrets.DOCKER_TAG }} diff --git a/README.md b/README.md index f809538..33eaaf8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # blue-music-be [![CI status][github-action-image]][github-action-url] -[github-action-image]: https://github.com/liuchuzhang/blue-music-be/actions/workflows/ci.yml/badge.svg -[github-action-url]: https://github.com/liuchuzhang/blue-music-be/actions/workflows/ci.yml +[github-action-image]: https://github.com/liuchuzhang/blue-music-be/actions/workflows/test.yml/badge.svg +[github-action-url]: https://github.com/liuchuzhang/blue-music-be/actions/workflows/test.yml ## Usage