This is an automated email from the ASF dual-hosted git repository. damccorm pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push: new 738c02cac4d Runner image buildx and Website Precommit update (#27427) 738c02cac4d is described below commit 738c02cac4d6a88faa3dd02606d50f1d2efed5e7 Author: Vlado Djerek <20559691+volatilemolo...@users.noreply.github.com> AuthorDate: Mon Jul 10 22:40:10 2023 +0200 Runner image buildx and Website Precommit update (#27427) * add buildx and fix gcloud * precommit website update and enable --- .../arc/images/Dockerfile | 8 ++- .github/workflows/beam_PreCommit_Website.yml | 79 ++++++++++++++++------ 2 files changed, 65 insertions(+), 22 deletions(-) diff --git a/.github/gh-actions-self-hosted-runners/arc/images/Dockerfile b/.github/gh-actions-self-hosted-runners/arc/images/Dockerfile index 5a646c6940c..61f05ef649a 100644 --- a/.github/gh-actions-self-hosted-runners/arc/images/Dockerfile +++ b/.github/gh-actions-self-hosted-runners/arc/images/Dockerfile @@ -17,8 +17,11 @@ # under the License. # - FROM ghcr.io/actions-runner-controller/actions-runner-controller/actions-runner:ubuntu-20.04 +#install BuildX +COPY --from=docker/buildx-bin:0.11.1 /buildx /usr/libexec/docker/cli-plugins/docker-buildx +RUN docker buildx install && docker buildx version + USER root #Install Node @@ -56,7 +59,8 @@ RUN curl -OL https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-c rm google-cloud-sdk-367.0.0-linux-x86_64.tar.gz && \ mv google-cloud-sdk /usr/local/google-cloud-sdk && \ /usr/local/google-cloud-sdk/install.sh --quiet && \ - /usr/local/google-cloud-sdk/bin/gcloud components install kubectl + /usr/local/google-cloud-sdk/bin/gcloud components install kubectl && \ + chown -R runner:runner /home/runner/.config/gcloud ENV PATH="${PATH}:/usr/local/google-cloud-sdk/bin" # Needed to transfer path addtitions to runner environment diff --git a/.github/workflows/beam_PreCommit_Website.yml b/.github/workflows/beam_PreCommit_Website.yml index 3152f2eda8c..4254a998eba 100644 --- a/.github/workflows/beam_PreCommit_Website.yml +++ b/.github/workflows/beam_PreCommit_Website.yml @@ -13,27 +13,66 @@ # See the License for the specific language governing permissions and # limitations under the License. -name: beam_PreCommit_Website +name: Website PreCommit on: - workflow_dispatch: + push: + tags: ['v*'] + branches: ['master', 'release-*'] + paths: ['website/**'] + pull_request_target: + branches: ['master', 'release-*'] + paths: ['website/**','.github/workflows/beam_PreCommit_Website.yml'] + issue_comment: + types: [created] + schedule: + - cron: '* */6 * * *' +#Setting explicit permissions for the action to avoid the default permissions which are `write-all` in case of pull_request_target event +permissions: + actions: write + pull-requests: read + checks: read + contents: read + deployments: read + id-token: none + issues: read + discussions: read + packages: read + pages: read + repository-projects: read + security-events: read + statuses: read jobs: - beam_PreCommit_Website: - if: ${{github.event.issue.pull_request}} || ${{github.event.comment.body == 'Run Website PreCommit'}} || ${{github.event.schedule}} - runs-on: [self-hosted, ubuntu-20.04] - name: beam_PreCommit_Website - steps: - - name: Git checkout - uses: actions/checkout@v3 - - name: Install Java - uses: actions/setup-java@v3.8.0 - with: - distribution: 'zulu' - java-version: '8' - - name: Setup Gradle - uses: gradle/gradle-build-action@v2 - with: - cache-read-only: false - - name: run websitePreCommit script - run: ./gradlew :websitePreCommit \ No newline at end of file + beam_PreCommit_Website: + if: | + github.event_name == 'push' || + github.event_name == 'pull_request_target' || + github.event.comment.body == 'Run Website PreCommit' || + github.event_name == 'schedule' + runs-on: [self-hosted, ubuntu-20.04, small] + name: beam_PreCommit_Website + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Rerun on comment + if: github.event.comment.body == 'Run Python_Coverage PreCommit' + uses: ./.github/actions/rerun-job-action + with: + pull_request_url: ${{ github.event.issue.pull_request.url }} + github_repository: ${{ github.repository }} + github_token: ${{ secrets.GITHUB_TOKEN }} + github_job: ${{ github.job }} + github_current_run_id: ${{ github.run_id }} + - name: Install Java + uses: actions/setup-java@v3.8.0 + with: + distribution: 'zulu' + java-version: '8' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + cache-read-only: false + - name: run websitePreCommit script + run: ./gradlew :websitePreCommit \ No newline at end of file