docker-image.yml 859 B

12345678910111213141516171819202122232425262728293031
  1. name: Docker Image CI
  2. on:
  3. push:
  4. branches: [ "main" ]
  5. workflow_dispatch:
  6. jobs:
  7. build:
  8. runs-on: ubuntu-latest
  9. permissions: write-all
  10. steps:
  11. - uses: actions/checkout@v3
  12. - uses: docker/login-action@v2.1.0
  13. with:
  14. registry: ghcr.io
  15. username: ${{ github.repository_owner }}
  16. password: ${{ secrets.GITHUB_TOKEN }}
  17. - id: owner
  18. uses: ASzc/change-string-case-action@v5
  19. with:
  20. string: ${{ github.repository_owner }}
  21. - id: repo
  22. uses: ASzc/change-string-case-action@v5
  23. with:
  24. string: ${{ github.event.repository.name }}
  25. - uses: docker/build-push-action@v4
  26. with:
  27. context: .
  28. file: Dockerfile
  29. push: true
  30. tags: |
  31. ghcr.io/${{ steps.owner.outputs.lowercase }}/${{ steps.repo.outputs.lowercase }}:latest