Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github action to build a gcloud docker image for PR requests #72

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/push-pr-to-gcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Docker image for PR

on:
pull_request:
branches:
- main

env:
PR_ID: ${{ github.event.number }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Build the Docker image
run: docker build . --file Dockerfile --tag us-central1-docker.pkg.dev/oss-fuzz-base/testing/oss-fuzz-gen-pull-request:pr-${{ env.PR_ID }}
- name: Authenticate to gcloud
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GCLOUD_CREDENTIAL }}'
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Auth to Artifact Registry
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Push to Artifact Registry
run: docker push us-central1-docker.pkg.dev/oss-fuzz-base/testing/oss-fuzz-gen-pull-request:pr-${{ env.PR_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/push-to-gcloud.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Image CI
name: Build Docker image from main

on:
push:
Expand Down
Loading