add gitaction for build #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
# Configure docker to use the gcloud command-line tool as a credential helper | |
- name: gcloud auth configure-docker | |
run: | | |
gcloud auth configure-docker us-central1-docker.pkg.dev | |
# Build docker image | |
- name: Build and Push docker image | |
env: | |
GOOLE_PROJECT: ${{secrets.GOOGLE_PROJECT}} | |
run: |- | |
docker build -f Dockerfile -t us-central1-docker.pkg.dev/$GOOGLE_PROJECT/discord-study-docker:$GITHUB_SHA . |