Skip to content

Commit df29ef1

Browse files
authored
Merge pull request #114 from wearearima/feature/deploy-to-google-app-engine
deploy: deploy to google app engine instead of github pages
2 parents a632158 + f09b5df commit df29ef1

File tree

4 files changed

+142
-37
lines changed

4 files changed

+142
-37
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/deploy.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build and Deploy Jekyll site
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
id-token: write
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Setup Ruby
24+
uses: ruby/setup-ruby@v1
25+
with:
26+
ruby-version: "2.7.1"
27+
bundler-cache: true
28+
29+
- name: Build Jekyll site
30+
env:
31+
JEKYLL_ENV: production
32+
run: bundle exec jekyll build --trace
33+
34+
- id: auth
35+
name: Authenticate to Google Cloud
36+
uses: google-github-actions/auth@v2
37+
with:
38+
workload_identity_provider: "projects/150426842195/locations/global/workloadIdentityPools/github-pool/providers/github-provider"
39+
service_account: "arima-blog-sa@blog-arima-eu.iam.gserviceaccount.com"
40+
41+
- name: Deploy to App Engine
42+
uses: google-github-actions/deploy-appengine@v2

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ docker volume create jekyll-ruby-gems
2626
Each time we want to launch our Jekyll container, run it like this:
2727
````
2828
docker run --rm -p 4000:4000 --name jekyll --volume="$PWD:/srv/jekyll" --mount source=jekyll-ruby-gems,target=/usr/local/bundle -it jekyll/jekyll:3.8 jekyll serve
29+
````
30+
31+
## Deployment
32+
33+
The site is published through Google App Engine. The workflow in `.github/workflows/deploy.yml` builds the Jekyll site and deploys the generated `_site` directory using Workload Identity Federation.

app.yaml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
runtime: python39
2+
3+
handlers:
4+
- url: /(.*\..*)
5+
static_files: _site/\1
6+
upload: _site/(.*)
7+
secure: always
8+
http_headers:
9+
Content-Security-Policy: >-
10+
default-src 'self';
11+
script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com https://www.gstatic.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com;
12+
style-src 'self' 'unsafe-inline';
13+
img-src 'self' data: https://www.google-analytics.com https://www.googletagmanager.com https://pbs.twimg.com https://ton.twimg.com https://abs.twimg.com;
14+
font-src 'self' data:;
15+
connect-src 'self' https://www.google-analytics.com https://www.googletagmanager.com https://stats.g.doubleclick.net https://region1.google-analytics.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com https://api.twitter.com;
16+
frame-src https://platform.twitter.com https://syndication.twitter.com;
17+
frame-ancestors 'self';
18+
object-src 'none';
19+
base-uri 'self';
20+
form-action 'self';
21+
manifest-src 'self';
22+
upgrade-insecure-requests;
23+
X-Frame-Options: SAMEORIGIN
24+
X-Content-Type-Options: nosniff
25+
Referrer-Policy: strict-origin-when-cross-origin
26+
Permissions-Policy: >-
27+
accelerometer=(),
28+
camera=(),
29+
geolocation=(),
30+
gyroscope=(),
31+
microphone=(),
32+
payment=(),
33+
usb=()
34+
35+
- url: /(.*)/
36+
static_files: _site/\1/index.html
37+
upload: _site/(.*)/index.html
38+
secure: always
39+
http_headers:
40+
Content-Security-Policy: >-
41+
default-src 'self';
42+
script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com https://www.gstatic.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com;
43+
style-src 'self' 'unsafe-inline';
44+
img-src 'self' data: https://www.google-analytics.com https://www.googletagmanager.com https://pbs.twimg.com https://ton.twimg.com https://abs.twimg.com;
45+
font-src 'self' data:;
46+
connect-src 'self' https://www.google-analytics.com https://www.googletagmanager.com https://stats.g.doubleclick.net https://region1.google-analytics.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com https://api.twitter.com;
47+
frame-src https://platform.twitter.com https://syndication.twitter.com;
48+
frame-ancestors 'self';
49+
object-src 'none';
50+
base-uri 'self';
51+
form-action 'self';
52+
manifest-src 'self';
53+
upgrade-insecure-requests;
54+
X-Frame-Options: SAMEORIGIN
55+
X-Content-Type-Options: nosniff
56+
Referrer-Policy: strict-origin-when-cross-origin
57+
Permissions-Policy: >-
58+
accelerometer=(),
59+
camera=(),
60+
geolocation=(),
61+
gyroscope=(),
62+
microphone=(),
63+
payment=(),
64+
usb=()
65+
66+
- url: /
67+
static_files: _site/index.html
68+
upload: _site/index.html
69+
secure: always
70+
http_headers:
71+
Content-Security-Policy: >-
72+
default-src 'self';
73+
script-src 'self' https://www.googletagmanager.com https://www.google-analytics.com https://www.gstatic.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com;
74+
style-src 'self' 'unsafe-inline';
75+
img-src 'self' data: https://www.google-analytics.com https://www.googletagmanager.com https://pbs.twimg.com https://ton.twimg.com https://abs.twimg.com;
76+
font-src 'self' data:;
77+
connect-src 'self' https://www.google-analytics.com https://www.googletagmanager.com https://stats.g.doubleclick.net https://region1.google-analytics.com https://platform.twitter.com https://cdn.syndication.twimg.com https://syndication.twitter.com https://api.twitter.com;
78+
frame-src https://platform.twitter.com https://syndication.twitter.com;
79+
frame-ancestors 'self';
80+
object-src 'none';
81+
base-uri 'self';
82+
form-action 'self';
83+
manifest-src 'self';
84+
upgrade-insecure-requests;
85+
X-Frame-Options: SAMEORIGIN
86+
X-Content-Type-Options: nosniff
87+
Referrer-Policy: strict-origin-when-cross-origin
88+
Permissions-Policy: >-
89+
accelerometer=(),
90+
camera=(),
91+
geolocation=(),
92+
gyroscope=(),
93+
microphone=(),
94+
payment=(),
95+
usb=()

0 commit comments

Comments
 (0)