Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 0327544

Browse files
authored
Merge pull request #40 from muhammetaliakbay/develop
Adapt to new options structure of ipfs api
2 parents f298c77 + 7809e2b commit 0327544

File tree

5 files changed

+9608
-30
lines changed

5 files changed

+9608
-30
lines changed

.github/workflows/docker-publish.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
# Publish `develop` as Docker `latest` image.
6+
branches:
7+
- develop
8+
9+
# Publish `v1.2.3` tags as releases.
10+
tags:
11+
- v*
12+
13+
# Run tests for any PRs.
14+
pull_request:
15+
16+
env:
17+
IMAGE_NAME: orbit-db-http-api
18+
19+
jobs:
20+
# Push image to GitHub Packages.
21+
# See also https://docs.docker.com/docker-hub/builds/
22+
push:
23+
runs-on: ubuntu-latest
24+
if: github.event_name == 'push'
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: Build image
30+
run: docker build . --file Dockerfile --tag $IMAGE_NAME
31+
32+
- name: Log into registry
33+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
34+
35+
- name: Push image
36+
run: |
37+
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
38+
39+
# Change all uppercase to lowercase
40+
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
41+
42+
# Strip git ref prefix from version
43+
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
44+
45+
# Strip "v" prefix from tag name
46+
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
47+
48+
# Use Docker `latest` tag convention
49+
[ "$VERSION" == "develop" ] && VERSION=latest
50+
51+
echo IMAGE_ID=$IMAGE_ID
52+
echo VERSION=$VERSION
53+
54+
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
55+
docker push $IMAGE_ID:$VERSION

0 commit comments

Comments
 (0)