I showed you my source code, pls respond
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.7 KiB

  1. name: Docker
  2. # This workflow uses actions that are not certified by GitHub.
  3. # They are provided by a third-party and are governed by
  4. # separate terms of service, privacy policy, and support
  5. # documentation.
  6. on:
  7. push:
  8. branches: [ main ]
  9. pull_request:
  10. branches: [ main ]
  11. env:
  12. # Use docker.io for Docker Hub if empty
  13. REGISTRY: ghcr.io
  14. # github.repository as <account>/<repo>
  15. IMAGE_NAME: ${{ github.repository }}
  16. jobs:
  17. build:
  18. runs-on: ubuntu-latest
  19. permissions:
  20. contents: read
  21. packages: write
  22. steps:
  23. - name: Checkout repository
  24. uses: actions/checkout@v2
  25. # Login against a Docker registry except on PR
  26. # https://github.com/docker/login-action
  27. - name: Log into registry ${{ env.REGISTRY }}
  28. if: github.event_name != 'pull_request'
  29. uses: docker/login-action@28218f9b04b4f3f62068d7b6ce6ca5b26e35336c
  30. with:
  31. registry: ${{ env.REGISTRY }}
  32. username: ${{ github.actor }}
  33. password: ${{ secrets.GITHUB_TOKEN }}
  34. # Extract metadata (tags, labels) for Docker
  35. # https://github.com/docker/metadata-action
  36. - name: Extract Docker metadata
  37. id: meta
  38. uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
  39. with:
  40. images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
  41. # Build and push Docker image with Buildx (don't push on PR)
  42. # https://github.com/docker/build-push-action
  43. - name: Build and push Docker image
  44. uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
  45. with:
  46. context: .
  47. push: ${{ github.event_name != 'pull_request' }}
  48. tags: ${{ steps.meta.outputs.tags }}
  49. labels: ${{ steps.meta.outputs.labels }}