This repository has been archived by the owner on Mar 15, 2024. It is now read-only.
Merge pull request #274 from MichalLauer/hf #50
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
on: | |
push: | |
branches: main | |
name: Deploy-app | |
jobs: | |
R-CMD-check: | |
runs-on: ubuntu-latest | |
name: ubuntu-release | |
env: | |
R_KEEP_PKG_SOURCE: yes | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: "4.3.0" | |
use-public-rspm: true | |
- name: Setup dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: any::rcmdcheck | |
needs: check | |
- name: Check package | |
uses: r-lib/actions/check-r-package@v2 | |
- name: test | |
run: ls check | |
- name: Upload result | |
uses: actions/upload-artifact@v4 | |
with: | |
path: check/MSMTProhlizec_0.8.9.tar.gz | |
name: r-shiny-latest | |
Deploy: | |
runs-on: ubuntu-latest | |
needs: R-CMD-check | |
env: | |
IMAGE_NAME: europe-west3-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.GCP_APP_NAME }}/${{ secrets.GCP_APP_NAME }} | |
GCP_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | |
GCP_APP_NAME: ${{ secrets.GCP_APP_NAME }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup GSA | |
run: | | |
echo $DEV_ENV_FILE >> ./gsa.json | |
env: | |
DEV_ENV_FILE : ${{ secrets.GCP_CREDENTIALS }} | |
- name: Download package | |
uses: actions/download-artifact@v4 | |
with: | |
name: "r-shiny-latest" | |
- name: Authenticate Cloud SDK | |
uses: google-github-actions/auth@v1 | |
with: | |
credentials_json: ${{ env.GCP_CREDENTIALS }} | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: Docker auth | |
run: gcloud auth configure-docker europe-west3-docker.pkg.dev | |
- name: Configure Docker | |
run: gcloud auth configure-docker --quiet | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.IMAGE_NAME }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Deploy Docker image | |
run: | | |
gcloud run deploy ${{ env.GCP_APP_NAME }} \ | |
--image ${{ env.IMAGE_NAME }} \ | |
--region europe-west3 \ | |
--platform managed \ | |
--port=80 \ | |
--allow-unauthenticated |