testing.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. name: Docker Build & Push For Testing
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. tag:
  6. description: "Тег Docker Image"
  7. required: true
  8. default: "testing"
  9. permissions:
  10. packages: write
  11. contents: write
  12. env:
  13. REPOSITORY: ${{ github.repository }}
  14. jobs:
  15. setup:
  16. name: Setup
  17. runs-on: ubuntu-latest
  18. outputs:
  19. repository: ${{ steps.vars.outputs.GITHUB_PROJECT_NAME }}
  20. steps:
  21. - name: Set lowercase repository
  22. id: vars
  23. run: echo "GITHUB_PROJECT_NAME=$(echo '${{ env.REPOSITORY }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
  24. build:
  25. name: Build Images
  26. runs-on: ubuntu-latest
  27. needs: setup
  28. steps:
  29. - name: Checkout
  30. uses: actions/checkout@v4
  31. - name: Setup Taskfile
  32. uses: pnorton5432/setup-task@v1
  33. with:
  34. task-version: 3.40.1
  35. - name: Log in to GitHub Container Registry
  36. uses: docker/login-action@v2
  37. with:
  38. registry: ghcr.io
  39. username: ${{ github.actor }}
  40. password: ${{ secrets.GITHUB_TOKEN }}
  41. - name: Build And Push Docker images
  42. run: task build-and-push-production-${{ github.event.inputs.tag }}
  43. env:
  44. GITHUB_PROJECT_NAME: ${{ needs.setup.outputs.repository }}