-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.26 KB
/
build.yaml
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
name: Deploy Discord-Study
on:
push:
branches:
- "main"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: code checkout
uses: actions/checkout@v2
- name: install gcloud CLI
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{secrets.GOOGLE_PROJECT}}
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
export_default_credentials: true
## gcloud auth configure-docker us-central1-docker.pkg.dev
# Configure docker to use the g cloud command-line tool as a credential helper
- name: gcloud auth configure-docker
run: |
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us-central1-docker.pkg.dev
# Build docker image
- name: Build docker image
env:
GOOGLE_PROJECT: ${{secrets.GOOGLE_PROJECT}}
run: |
docker build -f Dockerfile -t us-central1-docker.pkg.dev/$GOOGLE_PROJECT/discord-study-docker:$GITHUB_SHA .
# Push docker image
- name: Push docker image
env:
GOOGLE_PROJECT: ${{secrets.GOOGLE_PROJECT}}
run: |
docker push us-central1-docker.pkg.dev/$GOOGLE_PROJECT/discord-study-docker:$GITHUB_SHA