push-app-image.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. name: Push app image
  2. on:
  3. # This runs on v *.*.0 after the base image has been
  4. # built and pushed, or on patch version tag.
  5. push:
  6. tags:
  7. - "v*.*.[0-9]*"
  8. #workflow_run:
  9. # workflows:
  10. # - "Push base image"
  11. # types:
  12. # - "completed"
  13. env:
  14. DOCKER_USER: lcnetdev
  15. DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
  16. REPO_NAME: scriptshifter
  17. jobs:
  18. push-image-to-docker-hub:
  19. runs-on: ubuntu-latest
  20. steps:
  21. - name: checkout repo
  22. uses: actions/checkout@v4
  23. with:
  24. submodules: recursive
  25. - name: update version info
  26. run: |
  27. git fetch --tags
  28. git describe --tags --always >| VERSION
  29. git rev-parse HEAD >> VERSION
  30. - name: Build the Docker image
  31. run: >
  32. docker build -f Dockerfile .
  33. --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
  34. --tag $DOCKER_USER/$REPO_NAME:latest
  35. - name: Login to Docker Hub
  36. uses: docker/login-action@v3
  37. with:
  38. username: lcnetdev
  39. password: ${{ secrets.DOCKER_HUB }}
  40. - name: Push to Docker Hub
  41. run: docker push $DOCKER_USER/$REPO_NAME --all-tags