Skip to content

Commit

Permalink
add env keys in actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeriojr committed Apr 7, 2024
1 parent 4b85674 commit f76f564
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,22 @@ jobs:
uses: actions/checkout@v4
# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Generate sha

id: generate_sha
run: |
SHA=$(echo $GITHUB_SHA | head -c7)
echo "sha=$SHA" >> $GITHUB_OUTPUT
- name: Build docker image
run: |
docker build -t rogeriojr/projeto-nlw-node-fastify:${{ steps.generate_sha.outputs.sha }} .
- name: Log into the container register
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push image
run: |
docker push rogeriojr/projeto-nlw-node-fastify:${{ steps.generate_sha.outputs.sha }}

0 comments on commit f76f564

Please sign in to comment.