Skip to content

Commit

Permalink
Merge branch 'main' into fallback-channelId
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuleatt authored May 24, 2024
2 parents f90e017 + 7a831e3 commit e85db08
Show file tree
Hide file tree
Showing 19 changed files with 107,775 additions and 16,007 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

# Keep GitHub Actions up to date with GitHub's Dependabot...
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
day: "monday"
- package-ecosystem: github-actions
directory: /
groups:
github-actions:
patterns:
- "*" # Group all Actions updates into a single larger pull request
schedule:
interval: weekly
day: monday
2 changes: 1 addition & 1 deletion .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Build
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/deploy-preview-with-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: Deploy Preview with version

on: pull_request

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to Firebase Hosting preview channel
id: firebase_hosting_preview
uses: ./
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 14d
projectId: action-hosting-deploy-demo
entryPoint: "./demo"
firebaseToolsVersion: v11.12.0
2 changes: 1 addition & 1 deletion .github/workflows/deploy-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Deploy to Firebase Hosting preview channel
id: firebase_hosting_preview
uses: ./
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ jobs:
deploy_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# - run: npm run build
- uses: ./
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
channelId: live
projectId: action-hosting-deploy-demo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Check that Prettier was run
Expand Down
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ A full setup guide can be found [in the Firebase Hosting docs](https://firebase.
The [Firebase CLI](https://firebase.google.com/docs/cli) can get you set up quickly with a default configuration.

- If you've NOT set up Hosting, run this version of the command from the root of your local directory:

```bash
firebase init hosting
```

- If you've ALREADY set up Hosting, then you just need to set up the GitHub Action part of Hosting.
Run this version of the command from the root of your local directory:

```bash
firebase init hosting:github
```
Expand All @@ -41,7 +43,7 @@ jobs:
build_and_preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Add any build steps here. For example:
# - run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
Expand All @@ -62,7 +64,7 @@ name: Deploy to Live Channel
on:
push:
branches:
- master
- main
# Optionally configure to run only for specific files. For example:
# paths:
# - "website/**"
Expand All @@ -71,12 +73,11 @@ jobs:
deploy_live_website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Add any build steps here. For example:
# - run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
projectId: your-Firebase-project-ID
channelId: live
Expand Down Expand Up @@ -139,9 +140,17 @@ for more information about deploy targets.

### `entryPoint` _{string}_

The location of your [`firebase.json`](https://firebase.google.com/docs/cli#the_firebasejson_file)
The directory containing your [`firebase.json`](https://firebase.google.com/docs/cli#the_firebasejson_file)
file relative to the root of your repository. Defaults to `.` (the root of your repo).

### `firebaseToolsVersion` _{string}_

The version of `firebase-tools` to use. If not specified, defaults to `latest`.

### `disableComment` _{boolean}_

Disable commenting in a PR with the preview URL.

## Outputs

Values emitted by this action that can be consumed by other actions later in your workflow
Expand All @@ -152,7 +161,11 @@ The url(s) deployed to

### `expire_time`

The time the deployed preview urls expire
The time the deployed preview urls expire, example: 2024-04-10T14:37:53.817800922Z

### `expire_time_formatted`

The time the deployed preview urls expire in the UTC format, example: Tue, 09 Apr 2024 18:24:42 GMT

### `details_url`

Expand Down
14 changes: 13 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ branding:
icon: "globe"
color: "blue"
runs:
using: "node12"
using: "node20"
main: "bin/action.min.js"
inputs:
repoToken:
Expand Down Expand Up @@ -54,10 +54,22 @@ inputs:
directory"
default: "."
required: false
firebaseToolsVersion:
description: >-
The version of firebase-tools to use. Defaults to `latest`.
default: latest
required: false
disableComment:
description: >-
Disable auto-commenting with the preview channel URL to the pull request
default: "false"
required: false
outputs:
urls:
description: The url(s) deployed to
expire_time:
description: The time the deployed preview urls expire
expire_time_formatted:
description: The time the deployed preview urls expire in the UTC format
details_url:
description: A single URL that was deployed to
Loading

0 comments on commit e85db08

Please sign in to comment.