Merge pull request #358 from JarvusInnovations/develop #59
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |