push-app-image.yml 994 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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*.*.[1-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: Build the Docker image
  26. run: >
  27. docker build -f Dockerfile .
  28. --tag $DOCKER_USER/$REPO_NAME:${{ github.ref_name }}
  29. --tag $DOCKER_USER/$REPO_NAME:latest
  30. - name: Login to Docker Hub
  31. uses: docker/login-action@v3
  32. with:
  33. username: lcnetdev
  34. password: ${{ secrets.DOCKER_HUB }}
  35. - name: Push to Docker Hub
  36. run: docker push $DOCKER_USER/$REPO_NAME --all-tags