diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ea9acb2..8f840c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,17 +27,28 @@ jobs: # - run: npm publish # env: # NODE_AUTH_TOKEN: ${{secrets.npm_token}} - get-package-version: + + build-publish-docker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Package.json info - uses: rexdefuror/read-package-json@v1.0.5 + - uses: actions/checkout@v2 - - run: echo "name - ${{ env.PACKAGE_NAME }}" - - run: echo "version - ${{ env.PACKAGE_VERSION }}" - - run: echo "description - ${{ env.PACKAGE_DESCRIPTION }}" + - name: Get Version + uses: rexdefuror/read-package-json@v1.0.5 + + - uses: docker/setup-docker@v2 + with: + dockerfile: Dockerfile + context: . + version: '20.10.11' + + - 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 }} - - name: Display Version - run: echo "Package version is ${{ steps.get-version.outputs.version }}"