push-build.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. name: Push Image Build
  2. on:
  3. push:
  4. branches:
  5. - master
  6. - release-*
  7. tags:
  8. - v*
  9. defaults:
  10. run:
  11. # reference: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell
  12. shell: bash --noprofile --norc -eo pipefail -x {0}
  13. permissions:
  14. contents: read
  15. jobs:
  16. push-image-to-container-registry:
  17. runs-on: ubuntu-20.04
  18. if: github.repository == 'rook/rook'
  19. steps:
  20. - name: checkout
  21. uses: actions/checkout@v4
  22. with:
  23. fetch-depth: 0
  24. - uses: actions/setup-go@v4
  25. with:
  26. go-version: "1.21"
  27. # docker/setup-qemu action installs QEMU static binaries, which are used to run builders for architectures other than the host.
  28. - name: set up QEMU
  29. uses: docker/setup-qemu-action@master
  30. with:
  31. platforms: all
  32. - name: log in to container registry
  33. uses: docker/login-action@v3
  34. with:
  35. username: ${{ secrets.DOCKER_USERNAME }}
  36. password: ${{ secrets.DOCKER_PASSWORD }}
  37. - name: Configure AWS Credentials
  38. uses: aws-actions/configure-aws-credentials@v4
  39. with:
  40. aws-access-key-id: ${{ secrets.AWS_USR }}
  41. aws-secret-access-key: ${{ secrets.AWS_PSW }}
  42. aws-region: us-east-1
  43. # creating custom env var
  44. - name: set env
  45. run: |
  46. echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
  47. echo "GITHUB_REF"=${GITHUB_REF} >> $GITHUB_ENV
  48. - name: Install dependencies
  49. run: |
  50. python3 -m pip install --upgrade pip setuptools wheel
  51. sudo apt-get -q update
  52. sudo apt-get -q install -y python3-pygit2
  53. - name: Configure git user
  54. run: |
  55. # Use our Rook "service account"
  56. git config user.name Rook
  57. git config user.email "cncf-rook-info@lists.cncf.io"
  58. - name: build and release
  59. env:
  60. GIT_API_TOKEN: ${{ secrets.GIT_API_TOKEN }}
  61. BRANCH_NAME: ${{ env.BRANCH_NAME }}
  62. AWS_USR: ${{ secrets.AWS_USR }}
  63. AWS_PSW: ${{ secrets.AWS_PSW }}
  64. GITHUB_REF: $ {{ env.GITHUB_REF }}
  65. run: |
  66. tests/scripts/build-release.sh