-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (79 loc) · 2.36 KB
/
docker_quarto.yaml
File metadata and controls
89 lines (79 loc) · 2.36 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Publish docker on GHCR, then render and deploy quarto on GitHub pages
on:
push:
branches: [main]
workflow_dispatch:
inputs:
force_docker_build:
description: 'Force Docker build (skip change detection)'
required: true
type: boolean
default: false
skip_docker_build:
description: 'Skip Docker build (use last built image)'
required: true
type: boolean
default: false
jobs:
publish-docker:
name: Publish docker
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check if Docker build needed
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
docker:
- 'Dockerfile'
- 'environment.yaml'
- 'renv.lock'
- 'renv/**'
- name: Login to GitHub Container Registry
if: >
(!inputs.skip_docker_build) &&
(inputs.force_docker_build || steps.changes.outputs.docker == 'true')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
if: >
(!inputs.skip_docker_build) &&
(inputs.force_docker_build || steps.changes.outputs.docker == 'true')
uses: docker/build-push-action@v6
with:
context: .
tags: |
ghcr.io/pythonhealthdatascience/stars-testing-intro:latest
push: true
build-deploy:
runs-on: ubuntu-latest
needs: [publish-docker]
container:
image: ghcr.io/pythonhealthdatascience/stars-testing-intro:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
packages: read
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git safe directory
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Render and publish to GitHub pages
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}