Няма описание

build-webApp.yml 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. name: Build and push WebApp image
  2. on:
  3. push:
  4. # Publish semver tags as releases.
  5. tags: [ 'v*.*.*' ]
  6. pull_request:
  7. branches: [ "main" ]
  8. workflow_dispatch:
  9. env:
  10. REGISTRY: ghcr.io
  11. IMAGE_NAME: ${{ github.repository }}
  12. jobs:
  13. build-webapp:
  14. runs-on: ubuntu-latest
  15. permissions:
  16. packages: write
  17. contents: read
  18. steps:
  19. - run: |
  20. echo "The job was automatically triggered by a ${{ github.event_name }} event."
  21. echo "This job is now running on a ${{ runner.os }} server hosted by github!"
  22. echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
  23. - name: Check out repository code
  24. uses: actions/checkout@v4
  25. - name: Set up QEMU
  26. uses: docker/setup-qemu-action@v3
  27. with:
  28. platforms: 'arm64,amd64'
  29. - name: Set up Docker Buildx
  30. uses: docker/setup-buildx-action@v3
  31. - name: Log into registry ${{ env.REGISTRY }}
  32. if: github.event_name != 'pull_request'
  33. uses: docker/login-action@v3
  34. with:
  35. registry: ${{ env.REGISTRY }}
  36. username: ${{ github.actor }}
  37. password: ${{ secrets.GITHUB_TOKEN }}
  38. - name: Extract Docker metadata
  39. id: meta
  40. uses: docker/metadata-action@v5
  41. with:
  42. images: ${{ env.REGISTRY }}/dfir-iris/iriswebapp_app
  43. - name: Build and push
  44. uses: docker/build-push-action@v5
  45. with:
  46. context: .
  47. platforms: linux/amd64,linux/arm64
  48. push: ${{ github.event_name != 'pull_request' }} # Don't push on PR
  49. tags: ${{ steps.meta.outputs.tags }}
  50. labels: ${{ steps.meta.outputs.labels }}
  51. cache-from: type=gha
  52. cache-to: type=gha,mode=max
  53. file: docker/webApp/Dockerfile