Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 
 
 

52 rader
1.7 KiB

  1. on:
  2. push:
  3. tags:
  4. - 'v*'
  5. name: Build & Deploy Image
  6. jobs:
  7. build:
  8. name: Build & Release Image
  9. runs-on: self-hosted
  10. timeout-minutes: 2880
  11. env:
  12. working-directory: ./builder
  13. steps:
  14. - name: Checkout code
  15. uses: actions/checkout@v2
  16. - name: Build project
  17. id: builder
  18. working-directory: ${{ env.working-directory }}
  19. run: |
  20. bash build-docker.sh
  21. echo ::set-output name=filename::$(ls deploy/*.tar.xz | xargs -n 1 basename)
  22. - name: Fix Permissions
  23. id: fix_perm_filename
  24. run: |
  25. chmod a+rw ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  26. echo ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  27. - name: Create Release
  28. id: create_release
  29. uses: actions/create-release@v1
  30. env:
  31. GITHUB_TOKEN: ${{ secrets.LONG_TOKEN }}
  32. with:
  33. tag_name: ${{ github.ref }}
  34. release_name: Release ${{ github.ref }}
  35. draft: false
  36. prerelease: false
  37. - name: Upload Release Asset
  38. id: upload-release-asset
  39. uses: actions/upload-release-asset@v1
  40. env:
  41. GITHUB_TOKEN: ${{ secrets.LONG_TOKEN }}
  42. with:
  43. upload_url: ${{ steps.create_release.outputs.upload_url }}
  44. asset_path: ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}
  45. asset_name: ${{ steps.builder.outputs.filename }}
  46. asset_content_type: application/x-tar
  47. - name: Delete Image
  48. id: delete_image
  49. run: |
  50. rm ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }}