-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (68 loc) · 2.49 KB
/
publish-habitat.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
name: Publish Habitat package and studio
on:
push:
tags: [ 'v*' ]
env:
HAB_LICENSE: accept-no-persist
jobs:
publish-habitat:
runs-on: ubuntu-latest
steps:
- name: 'Initialize Chef Habitat environment'
uses: JarvusInnovations/habitat-action@action/v1
with:
deps: |
core/hab-plan-build
- uses: actions/checkout@v2
- name: Place tag in environment
run: |
echo "SOURCE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
echo "REPO_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Import origin key
run: |
hab origin key import <<END_OF_KEY
${{ secrets.HAB_ORIGIN_KEY }}
END_OF_KEY
hab origin key import <<END_OF_KEY
${{ secrets.HAB_ORIGIN_KEY_PUB }}
END_OF_KEY
- name: Setting package.json version
run: npm version --no-git-tag-version "${SOURCE_TAG#v}"
- name: Build jarvus/hologit
run: |
hab pkg exec core/hab-plan-build hab-plan-build .
source results/last_build.env
echo "HOLOGIT_PACKAGE=jarvus/hologit/${pkg_version}/${pkg_release}" >> $GITHUB_ENV
- name: Upload jarvus/hologit
env:
HAB_AUTH_TOKEN: '${{ secrets.HAB_AUTH_TOKEN }}'
run: |
source results/last_build.env
hab pkg upload "results/${pkg_artifact}" -c stable
- name: Build jarvus/hologit-studio
run: |
hab pkg exec core/hab-plan-build hab-plan-build studio
source results/last_build.env
echo "HOLOGIT_STUDIO_PACKAGE=jarvus/hologit-studio/${pkg_version}/${pkg_release}" >> $GITHUB_ENV
- name: Upload jarvus/hologit-studio
env:
HAB_AUTH_TOKEN: '${{ secrets.HAB_AUTH_TOKEN }}'
run: |
source results/last_build.env
hab pkg upload "results/${pkg_artifact}" -c stable
- name: Pull previous jarvus/hologit-studio:latest
run: docker pull jarvus/hologit-studio:latest || true
- name: Build new jarvus/hologit-studio:latest
run: |
docker build \
--build-arg "HOLOGIT_STUDIO_PACKAGE=${HOLOGIT_STUDIO_PACKAGE}" \
--cache-from "jarvus/hologit-studio:latest" \
--tag "jarvus/hologit-studio:latest" \
--tag "jarvus/hologit-studio:${SOURCE_TAG#v}" \
./studio
- name: Log into DockerHub
run: |
mkdir -p ~/.docker
echo "${{ secrets.DOCKER_CONFIG_BASE64 }}" | base64 -d > ~/.docker/config.json
- name: Push new jarvus/hologit-studio:latest
run: docker push jarvus/hologit-studio:latest