-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
name: Deploy Discord-Study | ||
name: Create and publish a Docker image to GCP Artifact Registry | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- main | ||
|
||
env: | ||
REGISTRY: ${{ secrets.GAR_REGISTRY }} | ||
IMAGE_NAME: image | ||
|
||
jobs: | ||
deploy: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: code checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: install gcloud CLI | ||
uses: google-github-actions/setup-gcloud@v1 | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
project_id: ${{secrets.GOOGLE_PROJECT}} | ||
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} | ||
export_default_credentials: true | ||
|
||
# Configure docker to use the g cloud command-line tool as a credential helper | ||
- name: gcloud auth configure-docker | ||
env: | ||
GOOGLE_PROJECT: ${{secrets.GOOGLE_PROJECT}} | ||
run: | | ||
gcloud auth configure-docker us-central1-docker.pkg.dev | ||
docker build -t us-central1-docker.pkg.dev/discord-study-bot-420101/discord-study-docker/image:latest . | ||
## docker push us-central1-docker.pkg.dev/discord-study-bot-420101/discord-study-docker/discord-study-docker:latest | ||
registry: ${{ env.REGISTRY }} | ||
username: _json_key | ||
password: ${{ secrets.GAR_JSON_KEY }} |