Skip to content

Commit

Permalink
Produção no Firebase Hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
dgadelha committed Jan 5, 2025
1 parent e305ae6 commit 5ee94a5
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deloy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Setup Firebase Hosting 🔥
env:
BETA_FIREBASE_PROJECT_ID: ${{ secrets.BETA_FIREBASE_PROJECT_ID }}
BETA_FIREBASE_PROJECT_ID: ${{ vars.BETA_FIREBASE_PROJECT_ID }}
BETA_FIREBASE_HOSTING_SITE: ${{ vars.BETA_FIREBASE_HOSTING_SITE }}
run: |
jq -n --arg default "$BETA_FIREBASE_PROJECT_ID" '{ "projects": { "default": $default } }' > .firebaserc
Expand Down
58 changes: 54 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,62 @@ jobs:
./packages/ide/cleanup-icons.sh
npm run release
- name: Setup Firebase Hosting 🔥
env:
FIREBASE_PROJECT_ID: ${{ vars.FIREBASE_PROJECT_ID }}
FIREBASE_HOSTING_SITE: ${{ vars.FIREBASE_HOSTING_SITE }}
run: |
jq -n --arg default "$FIREBASE_PROJECT_ID" '{ "projects": { "default": $default } }' > .firebaserc
cat <<EOF | tee firebase.json
{
"hosting": {
"site": "$FIREBASE_HOSTING_SITE",
"public": "packages/ide/dist/browser",
"headers": [
{
"source": "/**",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=900, stale-while-revalidate=180"
}
]
},
{
"source": "**/*.@(jpg|jpeg|gif|png|svg|webp|js|css|eot|otf|ttf|ttc|woff|woff2|font.css)",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=604800"
}
]
},
{
"source": "**/portugol-worker.js",
"headers": [
{
"key": "Cache-Control",
"value": "max-age=900, stale-while-revalidate=180"
}
]
}
],
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
}
EOF
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
uses: FirebaseExtended/action-hosting-deploy@v0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: packages/ide/dist/browser
firebaseServiceAccount: ${{ secrets.FIREBASE_SERVICE_ACCOUNT }}
projectId: ${{ vars.FIREBASE_PROJECT_ID }}
channelId: live

- name: Create Sentry release 📦
uses: getsentry/action-release@v1
Expand Down

0 comments on commit 5ee94a5

Please sign in to comment.