This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
85 lines (68 loc) · 2.72 KB
/
gh-page-dev.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
name: Build Dockerfile and Push Github page
on:
push:
branches:
- development
jobs:
build-and-push:
runs-on: ubuntu-18.04
timeout-minutes: 300
steps:
- uses: actions/checkout@v1
with:
ref: development
- name: cache data dir
uses: actions/cache@preview
with:
path: data
key: ${{ runner.os }}-mynumbercard-dev-${{ hashFiles(format('{0}{1}', github.workspace, '/VERSION')) }}
- uses: actions/checkout@v2
- id: cache-docker
uses: actions/cache@v1
with:
path: /tmp/docker-registry
key: docker-registry-no-buildkit-dev-${{ hashFiles('Dockerfile') }}
- name: Start local registry
run: docker run -d -p 5000:5000 --restart=always --name registry -v /tmp/docker-registry:/var/lib/registry registry:2 && npx wait-on tcp:5000
- name: Pull docker image from local registry
run: docker pull localhost:5000/mynumbercard-app || true
- name: Build Image when docker image cache not hit
run: docker build . -t mynumbercard-app --cache-from=localhost:5000/mynumbercard-app
if: steps.cache-docker.outputs.cache-hit != 'true'
- name: Push Image to local registry when docker image cache not hit
run: docker tag mynumbercard-app localhost:5000/mynumbercard-app && docker push localhost:5000/mynumbercard-app || true
if: steps.cache-docker.outputs.cache-hit != 'true'
- name: Tag pulled image to use docker-compose
run: docker tag localhost:5000/mynumbercard-app mynumbercard-app
if: steps.cache-docker.outputs.cache-hit == 'true'
- name: Make docker to look override docker-compose.yml only on CI
run: mv docker-compose.override.ci.yml docker-compose.override.yml
- name: Exec download and convert data
run: |
make download_and_convert
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "16.15.0"
- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/site/.cache/yarn
key: ${{ runner.os }}-yarn-dev-${{ hashFiles('~/site/**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-dev-
- name: Install dependencies
run: |
sudo apt-get install libvips-dev
- name: Install node dependencies
run: yarn install --frozen-lockfile
working-directory: site
- name: Run build for GitHub Pages
run: yarn build
working-directory: site
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site/public
publish_branch: gh-pages-dev