Skip to content

Commit

Permalink
ci: 환경변수 커스텀(refs/tags/v0.0.0 -> v0.0.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mincheol Kim authored Jul 30, 2020
1 parent 8a338a9 commit 4af403b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

# Setup gcloud CLI

- name: Get the version
id: get_version
run: echo "::set-env name=VERSION::${GITHUB_REF/refs\/tags\//}"

# Setup gcloud CLI
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '290.0.1'
Expand All @@ -45,17 +49,20 @@ jobs:
# Configure Docker to use the gcloud command-line tool as a credential
# helper for authentication
- run: |-
gcloud --quiet auth configure-docker
gcloud --quiet auth configure-docker
# Build the Docker image
- name: Build
run: |-
docker build --tag "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:$GITHUB_REF" .
docker build --tag "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:${{ env.VERSION }}" .
# Push the Docker image to Google Container Registry
- name: Publish
run: |-
docker push "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:$GITHUB_REF"
docker push "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:${{ env.VERSION }}"
- name: Deploy
run: |-
gcloud compute instances update-container "$GCE_INSTANCE" \
--zone "$GCE_INSTANCE_ZONE" \
--container-image "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:$GITHUB_REF"
--container-image "asia.gcr.io/$PROJECT_ID/$GCE_INSTANCE:${{ env.VERSION }}"

0 comments on commit 4af403b

Please sign in to comment.