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

Fix bucket name passing #11

Merged
merged 1 commit into from
Mar 1, 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
16 changes: 15 additions & 1 deletion .github/workflows/PREview-create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,31 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: true

data:
runs-on: ubuntu-latest
outputs:
URL: ${{ steps.data.outputs.URL }}
BUCKET: ${{ steps.data.outputs.BUCKET }}
BRANCH: ${{ steps.data.outputs.BRANCH }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Obtain URL
id: data
uses: ./.github/actions/PREview-data

build:
uses: ./.github/workflows/_build.yaml
with:
output_dir: build
secrets: inherit

deploy-update:
needs: [build]
needs: [data, build]
uses: ./.github/workflows/_deploy.yaml
with:
src_dir: build
bucket: ${{ needs.data.outputs.BUCKET }}
secrets: inherit

notify:
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/PREview-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@ on:
types: [synchronize]

jobs:
data:
runs-on: ubuntu-latest
outputs:
URL: ${{ steps.data.outputs.URL }}
BUCKET: ${{ steps.data.outputs.BUCKET }}
BRANCH: ${{ steps.data.outputs.BRANCH }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Obtain URL
id: data
uses: ./.github/actions/PREview-data

build:
uses: ./.github/workflows/_build.yaml
with:
output_dir: build
secrets: inherit

deploy-update:
needs: [build]
needs: [data, build]
uses: ./.github/workflows/_deploy.yaml
with:
src_dir: build
bucket: ${{ needs.data.outputs.BUCKET }}
secrets: inherit

notify:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/_deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
default: "build"
required: false
type: string
bucket:
description: "The GCS bucket to deploy to"
required: true
type: string

jobs:
deploy:
Expand All @@ -26,7 +30,5 @@ jobs:
credentials_json: "${{ secrets.GCP_SERVICE_ACCOUNT }}"
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: Obtain Bucket Name
uses: ./.github/actions/PREview-data
- name: Upload static content to buckets
run: gsutil -m -h "Cache-control:public, max-age=60" rsync -r -c -C -d ${{ inputs.src_dir }}/ gs://${BUCKET}
run: gsutil -m -h "Cache-control:public, max-age=60" rsync -r -c -C -d ${{ inputs.src_dir }}/ gs://${{ inputs.bucket }}
Loading