-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from lowply/v2
v2
- Loading branch information
Showing
5 changed files
with
45 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,4 @@ | ||
FROM node:10-slim | ||
|
||
LABEL "com.github.actions.name"="Deploy to Firebase" | ||
LABEL "com.github.actions.description"="Deploy to Firebase" | ||
LABEL "com.github.actions.icon"="cloud" | ||
LABEL "com.github.actions.color"="red" | ||
LABEL "repository"="https://github.com/lowply/deploy-firebase" | ||
LABEL "homepage"="https://github.com/lowply" | ||
LABEL "maintainer"="Sho Mizutani <lowply@github.com>" | ||
|
||
RUN npm install -g firebase-tools | ||
|
||
ADD entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
COPY entrypoint.sh /usr/local/bin | ||
ENTRYPOINT ["entrypoint.sh"] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
name: 'Deploy to Firebase' | ||
author: 'Sho Mizutani <lowply@github.com>' | ||
description: 'A GitHub Action to deploy to Firebase Hosting' | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
branding: | ||
icon: 'cloud' | ||
color: 'red' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
docker build -t lowply/deploy-firebase . |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "$FIREBASE_TOKEN" ]; then | ||
if [ -z "${FIREBASE_TOKEN}" ]; then | ||
echo "FIREBASE_TOKEN is missing" | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f ".firebaserc" ]; then | ||
echo ".firebaserc is missing" | ||
if [ -z "${FIREBASE_PROJECT}" ]; then | ||
echo "FIREBASE_PROJECT is missing" | ||
exit 1 | ||
fi | ||
|
||
if [ "${GITHUB_REF}" != "refs/heads/master" ]; then | ||
echo "Branch: ${GITHUB_REF}" | ||
echo "Aborting non-master branch deployment" | ||
exit 78 | ||
exit 1 | ||
fi | ||
|
||
firebase deploy --only hosting | ||
firebase deploy \ | ||
-m "${GITHUB_SHA}" \ | ||
--project ${FIREBASE_PROJECT} \ | ||
--only hosting |