Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

42 lignes
1.4 KiB

  1. on: ['pull_request']
  2. name: Build & Validate Image
  3. jobs:
  4. build:
  5. name: Build & Validate Image
  6. runs-on: self-hosted
  7. timeout-minutes: 2880
  8. env:
  9. working-directory: ./builder
  10. steps:
  11. - name: Checkout code
  12. uses: actions/checkout@v2
  13. - name: Clean docker
  14. id: clean_docker
  15. working-directory: ${{ env.working-directory }}
  16. run: |
  17. docker system prune -af
  18. docker system prune --volumes -f
  19. docker image prune -af
  20. docker container stop $(docker container ls -aq) || true
  21. docker container rm $(docker container ls -aq) || true
  22. - name: Build project
  23. id: builder
  24. working-directory: ${{ env.working-directory }}
  25. run: |
  26. bash build-docker.sh
  27. echo ::set-output name=filename::$(ls deploy/*.img.xz | xargs -n 1 basename)
  28. - name: Fix Permissions
  29. id: fix_perm_filename
  30. run: |
  31. chmod a+rw ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  32. echo ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  33. - uses: actions/upload-artifact@v1
  34. with:
  35. name: ${{ steps.builder.outputs.filename }}
  36. path: ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  37. - name: Delete Image
  38. id: delete_image
  39. run: |
  40. rm ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}