Skip to content

Commit ee66eaf

Browse files
authored
Refactor GitHub Actions workflow for R and Docker
Updated GitHub Actions workflow to use newer action versions and streamline Docker image build process.
1 parent ccc58c9 commit ee66eaf

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: R GitHub Actions dev-nf
1+
name: R GitHub Actions
22

33
on:
44
push:
@@ -15,7 +15,8 @@ jobs:
1515
RGL_USE_NULL: TRUE
1616

1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
19+
1920
- name: Setup R
2021
uses: r-lib/actions/setup-r@v2
2122
with:
@@ -25,28 +26,23 @@ jobs:
2526
run: |
2627
version=$(grep Version DESCRIPTION | grep -o "[0-9.]\+")
2728
echo "packageVersion=${version}" >> $GITHUB_ENV
28-
shell: bash {0}
29+
30+
# Login FIRST
31+
- name: Login to Docker Hub
32+
uses: docker/login-action@v3
33+
with:
34+
username: ${{ secrets.DOCKERHUB_USERNAME }}
35+
password: ${{ secrets.DOCKERHUB_TOKEN }}
2936

3037
- name: Set up Docker Buildx
31-
uses: docker/setup-buildx-action@v2
38+
uses: docker/setup-buildx-action@v3
3239

33-
- name: Build and push
34-
uses: docker/build-push-action@v4
40+
# Build once, push automatically
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@v6
3543
with:
36-
load: true
44+
push: true
3745
file: ./Dockerfile
3846
tags: |
3947
nfancy/scflow:latest
4048
nfancy/scflow:${{ env.packageVersion }}
41-
42-
43-
- name: Login to DockerHub
44-
uses: docker/login-action@v3
45-
with:
46-
username: ${{ secrets.DOCKERHUB_USERNAME }}
47-
password: ${{ secrets.DOCKERHUB_TOKEN }}
48-
49-
- name: push service
50-
run: |
51-
docker push nfancy/scflow:latest
52-
docker push nfancy/scflow:${{ env.packageVersion }}

0 commit comments

Comments
 (0)