Change bucket names to variables #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FC Kernels | |
on: | |
push: | |
permissions: | |
id-token: write | |
jobs: | |
publish: | |
name: Upload kernels | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup Service Account | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_PROVIDER }} | |
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT_EMAIL }} | |
- name: Build kernels | |
run: sudo make build | |
- name: Set bucket based on branch | |
id: set-bucket | |
run: | | |
if [ "${{ github.ref_name }}" = "main" ]; then | |
echo "DESTINATION=${{ vars.GCP_BUCKET_NAME }}/kernels" >> $GITHUB_OUTPUT | |
else | |
echo "DESTINATION=${{ vars.GCP_DEV_BUCKET_NAME }}/${{ github.ref_name }}" >> $GITHUB_OUTPUT | |
echo "You can copy the built kernels by running the following command in your infra repo:" | |
echo "gsutil cp -r builds gs://${{ vars.GCP_DEV_BUCKET_NAME }}/${{ github.ref_name }}/* gs://$(GCP_PROJECT_ID)-fc-kernels/" | |
fi | |
- name: Upload kernels | |
uses: "google-github-actions/upload-cloud-storage@v1" | |
with: | |
path: "./builds" | |
destination: ${{ steps.set-bucket.outputs.DESTINATION }}/kernels | |
gzip: false | |
parent: false |