push-test-image.yml 960 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Push test image
  2. on:
  3. push:
  4. branches:
  5. - "test"
  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. - name: checkout repo
  15. uses: actions/checkout@v4
  16. with:
  17. submodules: recursive
  18. - name: update version info
  19. run: |
  20. git fetch --tags
  21. git describe --tags --always >| VERSION
  22. git rev-parse HEAD >> VERSION
  23. - name: Build the Docker image
  24. run: >
  25. docker build -f Dockerfile .
  26. --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
  27. --tag $DOCKER_USER/$REPO_NAME:test
  28. - name: Login to Docker Hub
  29. uses: docker/login-action@v3
  30. with:
  31. username: lcnetdev
  32. password: ${{ secrets.DOCKER_HUB }}
  33. - name: Push to Docker Hub
  34. run: docker push $DOCKER_USER/$REPO_NAME:test