Merge pull request #8 from husni-zuhdi/get-blog-from-husni-blog-resou… #6
Workflow file for this run
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: Rust Build and Push | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build_push: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Setup Environment Variables | |
run: |- | |
echo "VERSION=${{ github.ref_name }}" >> "$GITHUB_ENV" | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Login to GCR | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }} | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
export_default_credentials: true | |
- name: Build Docker Image | |
run: |- | |
docker build -t husni-portfolio:$VERSION -f ./Dockerfile . | |
- name: Configure Docker Client | |
run: gcloud auth configure-docker --quiet | |
- name: Push Docker Image to Google Container/Artifact Registry | |
run: |- | |
docker tag husni-portfolio:$VERSION gcr.io/$GCP_PROJECT/husni-portfolio:$VERSION | |
docker push gcr.io/$GCP_PROJECT/husni-portfolio:$VERSION |