From 1683d053f2bb99e9007b857dc4f2d68809601513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Vodr=C3=A1=C5=BEka?= <36418132+DaveVodrazka@users.noreply.github.com> Date: Sat, 7 Dec 2024 11:08:17 +0100 Subject: [PATCH] Create release.yaml --- .github/workflows/release.yaml | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..2e7dfb2a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,47 @@ +name: Streamlit build and push Dockerimage + +on: + push: + branches: + - master + paths: + - "streamlit_dockerimage_version" + +env: + DOCKER_REGISTRY_HOST: europe-west1-docker.pkg.dev + GCP_PROJECT: carmine-api-381920 + +jobs: + release: + if: github.ref == 'refs/heads/master' + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Auth Google Cloud SDK + uses: google-github-actions/auth@v2 + with: + project_id: carmine-api-381920 + credentials_json: ${{ secrets.GCP_SA_KEY }} + + - name: Set up Google Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + with: + project_id: carmine-api-381920 + + - name: Configure Docker to use gcloud as a credential helper + run: | + gcloud auth configure-docker $DOCKER_REGISTRY_HOST + + - name: Build Docker image + id: build + run: | + VERSION=$(cat streamlit_dockerimage_version) + echo "VERSION=$VERSION" >> $GITHUB_ENV + docker build -t $DOCKER_REGISTRY_HOST/$GCP_PROJECT/docker-repository/derisk-starknet-fe:$VERSION -f Dockerfile.frontend . + + - name: Push Docker image + run: | + docker push $DOCKER_REGISTRY_HOST/$GCP_PROJECT/docker-repository/derisk-starknet-fe:${{ env.VERSION }}