-
Notifications
You must be signed in to change notification settings - Fork 45
89 lines (87 loc) · 2.87 KB
/
prod.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
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: Docker Build and Website Deploy
on:
push:
branches:
- main
- master
jobs:
docker:
if: "!contains(github.event.commits[0].message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
uses: docker/setup-buildx-action@v1
-
name: Login to DockerHub
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
id: docker_build
uses: docker/build-push-action@v2
env:
GITHUB_PAT: ${{ secrets.PAT }}
with:
push: true
tags: linogaliana/python-datascientist:latest
-
name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
blogdown:
name: Render-Blog
needs: docker
runs-on: ubuntu-latest
container: linogaliana/python-datascientist:latest
if: "!contains(github.event.commits[0].message, '[skip ci]')"
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Install rmarkdown
env:
GITHUB_PAT: ${{ secrets.PAT_GITHUB }}
run: |
Rscript -e 'install.packages(c("rmarkdown"))'
- name: install hugo
run: Rscript -e 'blogdown::install_hugo("0.83.0")'
- name: Install Python
run: |
Rscript -e "install.packages(c('remotes', 'reticulate'))"
Rscript -e "install.packages(c('here'))"
- shell: bash -l {0}
run: |
conda info
conda list
- name: Render blog
run: |
Rscript -e 'source("./build/build.R")'
- name: Install npm
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
uses: actions/setup-node@v2
with:
node-version: '12'
- name: Deploy to Netlify
if: ${{ github.repository == 'linogaliana/python-datascientist' }}
# NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID added in the repo's secrets
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
BRANCHE_REF: ${{ github.event.pull_request.head.ref }}
run: |
npm init -y
npm install --unsafe-perm=true netlify-cli -g
netlify deploy --prod --dir="public" --message "Deploy master"
- uses: actions/upload-artifact@v1
with:
name: public
path: public/