Tag and push latest Docker image #29
This file contains hidden or 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: Docker Image CI | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| workflow_dispatch: | |
| jobs: | |
| build-docker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Build the Docker image | |
| run: docker build . --file Dockerfile --tag lidorlg/lidor-python-sce:$(date +%F)-${{ github.run_number }} | |
| - name: docker login | |
| run: docker login -u ${{ secrets.dockerhub_user }} -p ${{ secrets.dockerhub_pass }} | |
| - name: docker push | |
| run: | | |
| docker push lidorlg/lidor-python-sce:$(date +%F)-${{ github.run_number }} | |
| docker tag lidorlg/lidor-python-sce:$(date +%F)-${{ github.run_number }} lidorlg/lidor-python-sce:latest | |
| docker push lidorlg/lidor-python-sce:latest |