File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # name: Deploy
1+ name : Deploy
22
3- # on:
4- # push:
5- # release:
6- # types: [published]
3+ on :
4+ push :
5+ release :
6+ types : [published]
77
8- # jobs:
9- # build-and-deploy:
10- # runs-on: ubuntu-18.04
11- # steps:
12- # - name: Checkout source code
13- # uses: actions/checkout@v1
14- # - name: Authenticate to Google Cloud
15- # run: |
16- # echo ${{ secrets.GOOGLE_CLOUD_KEY }} | base64 --decode > "$HOME"/google-cloud-key.json
17- # gcloud auth activate-service-account --key-file="$HOME"/google-cloud-key.json
18- # - name: Deploy to Cloud Run
19- # run: bin/deploy.sh
8+ jobs :
9+ build-and-deploy :
10+ runs-on : ubuntu-18.04
11+ steps :
12+ - name : Checkout source code
13+ uses : actions/checkout@v1
14+ - name : Authenticate to Google Cloud
15+ run : |
16+ echo ${{ secrets.GOOGLE_CLOUD_KEY }} | base64 --decode > "$HOME"/google-cloud-key.json
17+ gcloud auth activate-service-account --key-file="$HOME"/google-cloud-key.json
18+ - name : Deploy to Cloud Run
19+ run : bin/deploy.sh
Original file line number Diff line number Diff line change @@ -12,5 +12,6 @@ RUN apk --update --no-cache add ca-certificates && \
1212 update-ca-certificates && \
1313 sed -i "s/__SUBDOMAIN__/$SUBDOMAIN/g" /etc/nginx/conf.d/nginx.conf && \
1414 sed -i "s/__CLOUD_RUN_ID__/$CLOUD_RUN_ID/g" /etc/nginx/conf.d/nginx.conf
15+ ENV PORT 8080
1516
1617ENTRYPOINT ["./start.sh" ]
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ docker build -t dappface-api <path-to-api-project>
2121docker run --name dappface-api --rm -p 8080:8080 -e PROJECT_ID=$PROJECT_ID -e HOME=$HOME -v $HOME :$HOME dappface-api
2222
2323docker build \
24- --build-arg SUBDOMAIN=$SUBDOMAIN \
24+ --build-arg SUBDOMAIN=" $SUBDOMAIN " \
2525 --build-arg CLOUD_RUN_ID=" $CLOUD_RUN_ID " \
2626 -t dappface-api-proxy .
2727docker run -it --rm -p 80:80 --link dappface-api:dappface-api dappface-api-proxy
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ IMAGE_SRC_PATH=gcr.io/"$PROJECT_ID"/"$APP_NAME"
2323gcloud auth configure-docker
2424docker build \
2525 --build-arg SUBDOMAIN=" $SUBDOMAIN " \
26- --build-arg CLOUD_RUN_ID=" $CLOUD_RUN_ID "
26+ --build-arg CLOUD_RUN_ID=" $CLOUD_RUN_ID " \
2727 -t " $IMAGE_SRC_PATH " :latest \
2828 -t " $IMAGE_SRC_PATH " :" $GITHUB_SHA " .
2929docker push " $IMAGE_SRC_PATH " :latest
Original file line number Diff line number Diff line change 11server {
2- listen 80 default_server;
3- return 200 ;
4- }
5-
6- server {
7- listen 80 ;
2+ listen 8080 ;
83 server_name __SUBDOMAIN__.dappface.com;
94
105 location /query {
11- proxy_pass https://api-go-__CLOUD_RUN_ID__-ue.a.run.app: 80 /query;
6+ proxy_pass https://api-go-__CLOUD_RUN_ID__-ue.a.run.app/query;
127 proxy_read_timeout 900 ;
138 }
149
1510 location /contact {
16- proxy_pass https://api-rust-__CLOUD_RUN_ID__-ue.a.run.app: 80 /contact;
11+ proxy_pass https://api-rust-__CLOUD_RUN_ID__-ue.a.run.app/contact;
1712 proxy_read_timeout 900 ;
1813 }
1914
2015 location / {
21- proxy_pass https://api-go-__CLOUD_RUN_ID__-ue.a.run.app: 80 ;
16+ proxy_pass https://api-go-__CLOUD_RUN_ID__-ue.a.run.app;
2217 proxy_read_timeout 900 ;
2318 }
2419}
You can’t perform that action at this time.
0 commit comments