Upload example-vite to Google Cloud Storage #22
This file contains 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: GitHub Actions Demo | |
run-name: Upload example-vite to Google Cloud Storage | |
on: [push] | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
jobs: | |
build-and-push: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v3 | |
name: Install pnpm | |
with: | |
version: 8 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --strict-peer-dependencies | |
- name: Build | |
run: pnpm run build | |
- uses: "google-github-actions/auth@v2" | |
with: | |
project_id: "spaceblanc" | |
workload_identity_provider: projects/670988994997/locations/global/workloadIdentityPools/github/providers/ukstv-github | |
service_account: [email protected] | |
- id: "upload-file" | |
uses: "google-github-actions/upload-cloud-storage@v2" | |
with: | |
path: "${{ github.workspace }}/examples/example-vite/dist" | |
destination: "skyward-public.ukstv.me" | |
parent: false |