push-app-image.yml 964 B

123456789101112131415161718192021222324252627282930313233343536373839
  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 v
  5. push:
  6. tags:
  7. - "v*.*.[1-9]*"
  8. workflow_run:
  9. workflows: ["Push base image"]
  10. types: ["completed"]
  11. env:
  12. DOCKER_USER: lcnetdev
  13. DOCKER_PASSWORD: ${{secrets.DOCKER_HUB}}
  14. REPO_NAME: scriptshifter
  15. jobs:
  16. push-image-to-docker-hub:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: checkout repo
  20. uses: actions/checkout@v4
  21. with:
  22. submodules: recursive
  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:latest
  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 --all-tags