Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker image publish to dockerhub #40

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
name: Build Docker image
needs: test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4

Expand All @@ -52,12 +54,12 @@ jobs:

- name: Get version number
id: version
run: echo "VERSION=$(cat ./package.json | jq -r '.version')" >> $GITHUB_ENV
run: echo "version=$(cat ./package.json | jq -r '.version')" >> $GITHUB_OUTPUT

- name: Build Docker image
run: |
yarn nx run backend:docker-build --tag=${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ env.VERSION }}
docker save ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ env.VERSION }} > docker_image.tar
yarn nx run backend:docker-build --tag=${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ steps.version.outputs.version }}
docker save ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ steps.version.outputs.version }} > docker_image.tar

- name: Upload Docker image as artifact
uses: actions/upload-artifact@v3
Expand Down Expand Up @@ -85,4 +87,4 @@ jobs:
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Push Docker image
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ env.VERSION }}
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/stockdog:v-${{ needs.build.outputs.version }}
Loading