upload backend image to docker hub #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: betcycle-backend | |
on: | |
push: | |
branches: | |
- main | |
- feature/* | |
pull_request: | |
branches: | |
- main | |
env: | |
BUILD_ID: 0.0.${{github.run_number}} | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the Docker image | |
run: docker build --tag ${{secrets.DOCKER_USERNAME}}/betcycle-backend:$BUILD_ID --tag ${{secrets.DOCKER_USERNAME}}/betcycle-backend:latest ./backend | |
- name: Log in to Docker Hub | |
run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}} | |
- name: Push to Docker Hub | |
run: | | |
docker push ${{secrets.DOCKER_USERNAME}}/betcycle-backend:$BUILD_ID | |
docker push ${{secrets.DOCKER_USERNAME}}/betcycle-backend:latest | |
# - name: Build the Docker image | |
# #run: docker build . --file ./betcycle/backend/Dockerfile --tag betcycle-backend:$(date +%s) | |
# run: docker build --tag ${{secrets.DOCKER_USERNAME}}/betcycle-backend:$BUILD_ID --tag ${{secrets.DOCKER_USERNAME}}/betcycle-backend:latest ./betcycle/backend | |
# | |
# - name: Upload coverage reports to Codecov | |
# uses: codecov/codecov-action@v3 | |
# env: | |
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
# | |
# - name: Upload coverage report to Codacy | |
# run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r <coverage report file name> | |
# | |
# - name: Log in to Docker Hub | |
# run: docker login -u ${{secrets.DOCKER_USERNAME}} -p ${{secrets.DOCKER_PASSWORD}} | |
# | |
# - name: Push to Docker Hub | |
# run: | | |
# docker push ${{secrets.DOCKER_USERNAME}}/betcycle-backend:$BUILD_ID | |
# docker push ${{secrets.DOCKER_USERNAME}}/betcycle-backend:latest | |