Merge pull request #15 from hypersign-protocol/CD #9
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: Vault Service Build and Publish to google artifact repository | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
build-push-artifact: | |
runs-on: ubuntu-latest | |
steps: | |
- name: code checkout | |
uses: actions/checkout@v3 | |
- id: "auth" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}" | |
- name: install gcloud cli tools | |
uses: google-github-actions/setup-gcloud@v1 | |
with: | |
project_id: ${{secrets.GOOGLE_PROJECT_ID}} | |
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}} | |
export_default_credentials: true | |
- name: "Use gcloud CLI" | |
run: "gcloud info" | |
- name: "Docker Auth" | |
run: gcloud auth configure-docker asia-south1-docker.pkg.dev | |
- name: "Docker Build" | |
env: | |
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} | |
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}} | |
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}} | |
run: docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:latest . | |
- name: Push image | |
env: | |
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}} | |
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_REPO}} | |
run: docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/vault-service:latest | |