-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (45 loc) · 1.58 KB
/
on-master.yaml
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
name: Docker Build
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
# - name: Install Yarn
# run: npm install -g yarn
- name: Setup and build
working-directory: ./newclient
run: |
cp .npmrc.example .npmrc && sed -i "s/TOKEN/${{ secrets.ACCESS_TOKEN }}/" .npmrc
yarn
yarn build
build:
name: Run docker build
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Get the version
id: vars
run: |
echo ::set-output name=sha::$(echo ${GITHUB_SHA:0:7})
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
- name: Run docker build
working-directory: ./newclient
run: docker build -t vulcanize/ipld-block-explorer --build-arg GITHUB_TOKEN=${{ secrets.ACCESS_TOKEN }} .
- name: Tag docker image
run: docker tag vulcanize/ipld-block-explorer docker.pkg.github.com/vulcanize/ipld-block-explorer/ipld-block-explorer:${{steps.vars.outputs.sha}}
- name: Docker Login
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login https://docker.pkg.github.com -u vulcanize --password-stdin
- name: Docker Push
run: docker push docker.pkg.github.com/vulcanize/ipld-block-explorer/ipld-block-explorer:${{steps.vars.outputs.sha}}