Skip to content

Commit

Permalink
Merge pull request #249 from davidycliao/0.0.7
Browse files Browse the repository at this point in the history
0.0.7
  • Loading branch information
davidycliao authored Dec 30, 2024
2 parents 23e89ed + aa1a283 commit 74b6e90
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,43 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'

- name: Check Python Version
run: python --version

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install flair
- name: Install R dependencies
run: |
install.packages('remotes')
remotes::install_github("davidycliao/flaiR", force = TRUE)
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
Expand All @@ -58,21 +65,24 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2


- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/flair:latest
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ RUN R -e "install.packages(c('remotes', \
'knitr', 'rmarkdown', 'lsa', 'purrr', 'jsonlite', 'ggplot2', 'plotly', 'testthat'), \
repos='https://cloud.r-project.org/')"

# 從 GitHub 安裝 flaiR
RUN R -e "remotes::install_github('davidycliao/flaiR', force = TRUE)"
# 複製你的 R 包源碼到容器中
COPY . /pkg
WORKDIR /pkg

# 從本地安裝套件
RUN R -e "remotes::install_local('/pkg', force = TRUE)"

# 設定預設命令
CMD ["R"]

0 comments on commit 74b6e90

Please sign in to comment.