-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (42 loc) · 1.51 KB
/
release.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
name: Build and Release Docker Image
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build and Push Docker Image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Log Variables
run: |
echo "action - ${{ github.event.action }}"
echo "url - ${{ github.event.release.url }}"
echo "assets_url - ${{ github.event.release.assets_url }}"
echo "id - ${{ github.event.release.id }}"
echo "tag_name - ${{ github.event.release.tag_name }}"
echo "assets - ${{ github.event.assets }}"
echo "assets[0] - ${{ github.event.assets[0] }}"
- name: Download release
uses: sondreb/action-release-download@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
url: ${{ github.event.release.assets_url }}
folder: "./artifacts/"
- name: Extract asset and copy
run: |
mkdir ./src/
tar -C ./src/ -xzvf ./artifacts/blockcore-hub-${{ github.event.release.tag_name }}.tgz --strip-components=1
ls -R
- name: Install and Build
working-directory: app
run: |
npm ci --force
npm run build
- name: Build the Docker container image
run: docker build srv/. -t blockcore/blockcore-hub:latest -t blockcore/blockcore-hub:${{ github.event.release.tag_name }}
- name: Login and Push to Docker Registry
run: |
docker login -u "sondreb" -p "${{secrets.DOCKER_KEY}}"
docker push --all-tags blockcore/blockcore-hub