-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.95 KB
/
habitat-publish.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
name: 'Habitat: Publish and Promote Package'
on:
push:
tags: [ 'v*' ]
env:
HAB_LICENSE: accept-no-persist
jobs:
habitat-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setting package.json version
run: npm version --no-git-tag-version --allow-same-version "${GITHUB_REF:11}"
- uses: JarvusInnovations/infra-components@channels/github-actions/habitat-publish/latest
with:
checkout: false
hab-origin-key-secret: ${{ secrets.HAB_ORIGIN_KEY }}
hab-origin-key-public: ${{ secrets.HAB_ORIGIN_KEY_PUB }}
hab-auth-token: ${{ secrets.HAB_AUTH_TOKEN }}
- name: Login to ghcr.io
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Compute Docker container image path
run: |
source results/last_build.env
DOCKER_REPOSITORY="${GITHUB_REPOSITORY,,}"
DOCKER_IMAGE="ghcr.io/${DOCKER_REPOSITORY}"
echo "Using path: ${DOCKER_IMAGE}"
# set environment variables
echo "DOCKER_REPOSITORY=${DOCKER_REPOSITORY}" >> $GITHUB_ENV
echo "DOCKER_IMAGE=${DOCKER_IMAGE}" >> $GITHUB_ENV
echo "DOCKER_VERSION=${pkg_version}" >> $GITHUB_ENV
- name: Build Docker container image
run: |
source results/last_build.env
hab pkg export container "results/${pkg_artifact}"
- name: Tag Docker container image
run: |
docker tag "jarvus/habitat-compose:latest" "${DOCKER_IMAGE}:latest"
docker tag "jarvus/habitat-compose:latest" "${DOCKER_IMAGE}:${DOCKER_VERSION}"
docker tag "jarvus/habitat-compose:latest" "${DOCKER_IMAGE}:${DOCKER_VERSION%.*}"
- name: Push Docker container image tags
run: |
docker push "${DOCKER_IMAGE}:latest"
docker push "${DOCKER_IMAGE}:${DOCKER_VERSION}"
docker push "${DOCKER_IMAGE}:${DOCKER_VERSION%.*}"