devcontainer.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. name: build devcontainer image
  3. 'on':
  4. push:
  5. branches:
  6. - master
  7. # Allows you to run this workflow manually from the Actions tab
  8. workflow_dispatch:
  9. inputs:
  10. force:
  11. required: true
  12. type: boolean
  13. default: false
  14. env:
  15. DIST: bookworm
  16. jobs:
  17. build:
  18. runs-on: ubuntu-latest
  19. permissions:
  20. contents: read
  21. packages: write
  22. steps:
  23. - uses: actions/checkout@v4
  24. with:
  25. fetch-depth: 2
  26. - name: print latest_commit
  27. run: echo ${{ github.sha }}
  28. - name: Get changed files
  29. if: ${{ ! inputs.force }}
  30. id: changed-files
  31. uses: tj-actions/changed-files@v44
  32. with:
  33. since_last_remote_commit: true
  34. - name: changes in relevant files
  35. if: ${{ ! inputs.force }}
  36. id: changed-files-builder
  37. uses: tj-actions/changed-files@v44
  38. with:
  39. files: |
  40. .devcontainer/**
  41. pkg/kamailio/deb/${{ env.DIST }}/**
  42. - name: Login to GitHub Container Registry
  43. if: steps.changed-files-builder.outputs.any_changed == 'true' || inputs.force
  44. uses: docker/login-action@v3
  45. with:
  46. registry: ghcr.io
  47. username: ${{ github.repository_owner }}
  48. password: ${{ secrets.GITHUB_TOKEN }}
  49. - name: Pre-build dev container image
  50. if: steps.changed-files-builder.outputs.any_changed == 'true' || inputs.force
  51. uses: devcontainers/[email protected]
  52. with:
  53. imageName: ghcr.io/${{ github.repository_owner }}/kamailio-${{ github.ref_name }}-devcontainer
  54. cacheFrom: ghcr.io/${{ github.repository_owner }}/kamailio-${{ github.ref_name }}-devcontainer
  55. push: always