CD Docker.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: CD Docker
  2. on:
  3. workflow_dispatch:
  4. workflow_run:
  5. workflows: ["CI Dependencies"]
  6. branches:
  7. - main
  8. types:
  9. - completed
  10. jobs:
  11. docker:
  12. runs-on: ubuntu-latest
  13. permissions:
  14. contents: read
  15. packages: write
  16. steps:
  17. - name: Checkout
  18. uses: actions/checkout@v3
  19. - uses: actions/setup-python@v2
  20. with:
  21. python-version: "3.x"
  22. - name: Set up QEMU
  23. uses: docker/setup-qemu-action@v1
  24. - name: Set up Docker Buildx
  25. uses: docker/setup-buildx-action@v1
  26. - name: Login to GitHub Container Registry
  27. uses: docker/login-action@v1
  28. with:
  29. registry: ghcr.io
  30. username: ${{ github.repository_owner }}
  31. password: ${{ secrets.GITHUB_TOKEN }}
  32. - run: echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
  33. - name: Build and push
  34. uses: docker/build-push-action@v2
  35. with:
  36. context: .
  37. platforms: linux/amd64
  38. push: true
  39. tags: |
  40. ghcr.io/${{ env.IMAGE_REPOSITORY }}:main