-
Notifications
You must be signed in to change notification settings - Fork 2
41 lines (38 loc) · 1.39 KB
/
docker-image-rstudio-gcp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Docker Image CI rstudio-gcp
env:
IMAGE_NAME: rstudio-gcp
IMAGE_TAG: v1.0.2
IMAGE_BRANCH: main
IMAGE_DIR: draft_images
on:
workflow_dispatch: null
push:
branches: main
paths:
- 'draft_images/rstudio-gcp/**'
- '.github/workflows/docker-image-rstudio-gcp.yml'
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Login to GitHub Container Registry
if: github.repository == 'nmfs-opensci/container-images'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Check permision on entrypoint.sh
run: |
chmod +x $IMAGE_DIR/$IMAGE_NAME/assets/google/scripts/entrypoint.sh
- name: Build the Docker image
if: github.repository == 'nmfs-opensci/container-images'
run: |
docker build $IMAGE_DIR/$IMAGE_NAME -f $IMAGE_DIR/$IMAGE_NAME/Dockerfile --tag ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:$IMAGE_TAG --tag ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:latest
- name: Publish
if: github.repository == 'nmfs-opensci/container-images'
run: |
docker push ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:$IMAGE_TAG
docker push ghcr.io/nmfs-opensci/container-images/$IMAGE_NAME:latest