push-docker-image.yml 757 B

1234567891011121314151617181920212223242526272829303132
  1. name: Push image to Docker Hub.
  2. on:
  3. push:
  4. tags:
  5. - "v*.*.*"
  6. env:
  7. DOCKER_USER: lcnetdev
  8. DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
  9. REPO_NAME: scriptshifter
  10. jobs:
  11. push-image-to-docker-hub:
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v3
  15. with:
  16. submodules: recursive
  17. - name: Build the Docker image
  18. run: >
  19. docker build . --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
  20. --tag $DOCKER_USER/$REPO_NAME:latest
  21. - name: Login to Docker Hub
  22. uses: docker/login-action@v3
  23. with:
  24. username: lcnetdev
  25. password: ${{ secrets.DOCKER_HUB }}
  26. - name: Push to Docker Hub
  27. run: docker push $DOCKER_USER/$REPO_NAME --all-tags