Dockerfile changes #22
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: Build & Publish GridWatch Image | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v*.*.*-gridwatch-* | |
env: | |
REPO: gcr.io/powerwatch-backend/nline-grafana-image | |
jobs: | |
build-and-push-to-gcr: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCLOUD_JSON }} | |
- name: Configure Docker for GCR | |
run: | | |
gcloud --quiet auth configure-docker | |
gcloud --quiet config set project powerwatch-backend | |
- name: Build and push Docker image | |
run: | | |
NAME=$REPO:${{github.ref_name}} | |
docker build -t $NAME -f Dockerfile . | |
docker push $NAME | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.docker | |
key: ${{ runner.os }}-docker-${{ hashFiles('**`/Dockerfile') }} | |
restore-keys: | | |
${{ runner.os }}-docker- |