-
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (51 loc) · 1.62 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Deploy
on:
push:
branches:
- master
permissions:
packages: write # to deploy to ghcr
id-token: write # for google-github-actions/setup-gcloud
env:
HEROKU_APP: calm-escarpment-99854
jobs:
heroku:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: |
heroku container:login
docker build -t registry.heroku.com/$HEROKU_APP/web .
docker push registry.heroku.com/$HEROKU_APP/web
heroku container:release web --app $HEROKU_APP
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
gcp:
runs-on: ubuntu-latest
env:
IMAGE: gcr.io/javadocky/${{ secrets.GCP_APP_NAME }}:${{ github.sha }}
steps:
- uses: actions/checkout@v3
- uses: google-github-actions/auth@v0
with:
workload_identity_provider: projects/905134421768/locations/global/workloadIdentityPools/actions-javadocky/providers/actions-javadocky
service_account: ${{ secrets.GCP_EMAIL }}
project_id: javadocky
- uses: google-github-actions/setup-gcloud@v0
- run: |
gcloud auth configure-docker
docker build -t $IMAGE .
docker push $IMAGE
gcloud run deploy javadocky --image $IMAGE --region asia-northeast1
ghcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build Image
run: |
echo $GITHUB_TOKEN | docker login https://ghcr.io -u $USER_NAME --password-stdin
docker build -t ghcr.io/kengotoda/javadocky .
docker push ghcr.io/kengotoda/javadocky
env:
USER_NAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}