Skip to content

[docker] add spdep and rstan #336

[docker] add spdep and rstan

[docker] add spdep and rstan #336

name: Build-Docker
on:
push:
branches:
- 'main'
jobs:
docker:
if: "contains(github.event.head_commit.message, '[docker]')"
runs-on: ubuntu-22.04
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
QUARTO_VERSION: "1.4.395"
CMDSTAN_VERSION: "2.33.1"
REGISTRY: ghcr.io/xiangyunhuang
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
# - name: Build and push fedora-rstudio
# uses: docker/build-push-action@v3
# with:
# context: .
# file: ./fedora_rstudio_pro.Dockerfile
# target: fedora-rstudio
# pull: true
# push: true
# build-args: |
# QUARTO_VERSION=${{ env.QUARTO_VERSION }}
# tags: ${{ env.REGISTRY }}/fedora-rstudio:latest
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Build and push fedora-rstudio-pro
uses: docker/build-push-action@v3
with:
context: .
file: ./fedora_rstudio_pro.Dockerfile
target: fedora-rstudio-pro
pull: true
push: true
build-args: |
QUARTO_VERSION=${{ env.QUARTO_VERSION }}
CMDSTAN_VERSION=${{ env.CMDSTAN_VERSION }}
GITHUB_PAT=${{ env.GITHUB_PAT }}
tags: ${{ env.REGISTRY }}/fedora-rstudio-pro:${{ env.QUARTO_VERSION }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache