Skip to content

Commit 8d2ac08

Browse files
authored
chore: stop using cloudflare pages (angular#984)
1 parent baf8d5a commit 8d2ac08

File tree

6 files changed

+67
-43
lines changed

6 files changed

+67
-43
lines changed

.github/workflows/adev-preview-deploy.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ jobs:
4848
COMMIT_HASH=$(cat ./$BUILD_DIR/__metadata__commit_hash.txt)
4949
echo "value=$COMMIT_HASH" >> $GITHUB_OUTPUT
5050
- run: echo ${{ steps.pr-number.outputs.value }} ${{ steps.commit-hash.outputs.value }}
51-
- name: Deploy to cloudflare pages
52-
run: npx wrangler pages deploy $BUILD_DIR --project-name $CLOUDFLARE_PAGES_PROJECT --branch pr-$PR_NUMBER --commit-hash $COMMIT_HASH
53-
env:
54-
PR_NUMBER: ${{ steps.pr-number.outputs.value }}
55-
COMMIT_HASH: ${{ steps.commit-hash.outputs.value }}
56-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
57-
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
58-
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
5951
- name: Deploy to Firebase Hosting Preview
6052
id: firebase-deploy
6153
uses: FirebaseExtended/[email protected]
@@ -82,6 +74,5 @@ jobs:
8274
comment-id: ${{ steps.find-comment.outputs.comment-id }}
8375
edit-mode: replace
8476
body: |
85-
Preview deployed: (commit: ${{ steps.commit-hash.outputs.value }})
86-
- https://pr-${{ steps.pr-number.outputs.value }}.dev-angular-jp.pages.dev
87-
- ${{ steps.firebase-deploy.outputs.details_url }}
77+
Preview deployed: ${{ steps.firebase-deploy.outputs.details_url }} (commit: ${{ steps.commit-hash.outputs.value }})
78+

.github/workflows/adev-production-deploy.yml

-7
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ jobs:
3737
common --color=yes
3838
- run: yarn install
3939
- run: yarn build
40-
- name: Deploy to cloudflare pages
41-
run: npx wrangler pages deploy $OUTPUT_DIR --project-name $CLOUDFLARE_PAGES_PROJECT
42-
env:
43-
OUTPUT_DIR: build/dist/bin/adev/build/browser
44-
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
45-
CLOUDFLARE_ACCOUNT_ID: ${{ vars.CLOUDFLARE_ACCOUNT_ID }}
46-
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
4740
- name: Deploy to Firebase Hosting
4841
uses: FirebaseExtended/[email protected]
4942
with:

DEPLOYMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# デプロイ
22

3-
https://angular.jpCloudflare Pages でホストされています。
3+
https://angular.jpFirebase Hosting でホストされています。
44
現在の管理者は @lacolaco です。

adev-ja/_headers

-7
This file was deleted.

firebase.json

+63-16
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,64 @@
11
{
2-
"hosting": {
3-
"public": "build/dist/bin/adev/build/browser",
4-
"ignore": [
5-
"firebase.json",
6-
"**/.*",
7-
"**/node_modules/**"
8-
],
9-
"rewrites": [
10-
{
11-
"source": "**",
12-
"destination": "/index.html"
13-
}
14-
],
15-
"trailingSlash": false
16-
}
17-
}
2+
"hosting": {
3+
"public": "build/dist/bin/adev/build/browser",
4+
"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
5+
"rewrites": [
6+
{
7+
"source": "**",
8+
"destination": "/index.html"
9+
}
10+
],
11+
"headers": [
12+
{
13+
"source": "assets/images/tutorials/common/*.jpg",
14+
"headers": [
15+
{
16+
"key": "Cross-Origin-Resource-Policy",
17+
"value": "cross-origin"
18+
},
19+
{
20+
"key": "Access-Control-Allow-Origin",
21+
"value": "*"
22+
}
23+
]
24+
},
25+
{
26+
"source": "*.[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].+(css|js)",
27+
"headers": [
28+
{
29+
"key": "Cache-Control",
30+
"value": "public,max-age=31536000,immutable"
31+
},
32+
{
33+
"key": "Access-Control-Allow-Origin",
34+
"value": "*"
35+
}
36+
]
37+
},
38+
{
39+
"source": "/[0-9a-f][0-9a-f][0-9a-f].[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f].js",
40+
"headers": [
41+
{
42+
"key": "Cross-Origin-Embedder-Policy",
43+
"value": "require-corp"
44+
}
45+
]
46+
},
47+
{
48+
"source": "/**",
49+
"headers": [
50+
{
51+
"key": "Cross-Origin-Opener-Policy",
52+
"value": "same-origin"
53+
},
54+
55+
{
56+
"key": "Cross-Origin-Embedder-Policy",
57+
"value": "require-corp"
58+
}
59+
]
60+
}
61+
],
62+
"trailingSlash": false
63+
}
64+
}

tools/lib/localize.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export async function modifyBuildOutput() {
7878
* Copy static files into build output directory
7979
*/
8080
async function copyStaticFiles() {
81-
const files = ['_headers'];
81+
const files: string[] = [];
8282
for (const file of files) {
8383
const src = resolve(adevJaDir, file);
8484
const dest = resolve(buildOutputDir, file);

0 commit comments

Comments
 (0)