Skip to content

Commit d358e59

Browse files
Merge pull request #4 from UnstoppableMango/sub-versioning
2 parents 8fd8b0b + e9b5642 commit d358e59

File tree

3 files changed

+50
-3
lines changed

3 files changed

+50
-3
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
uses: docker/setup-buildx-action@v1
2626

2727
- name: Set Version
28-
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV
28+
run: |
29+
GIT_HASH=$(git rev-parse --short "$GITHUB_SHA")
30+
echo "VERSION=$(cat VERSION).$GIT_HASH" >> $GITHUB_ENV
31+
echo "APP_VERSION=$(cut -d'-' -f 1 VERSION)" >> $GITHUB_ENV
2932
3033
- name: Build and Push
3134
uses: docker/build-push-action@v2
@@ -34,7 +37,7 @@ jobs:
3437
file: ./Dockerfile
3538
builder: ${{ steps.buildx.outputs.name }}
3639
push: ${{ github.event_name != 'pull_request' }}
37-
args: VERSION=${{ env.VERSION }}
40+
build-args: VERSION=${{ env.APP_VERSION }}
3841
tags: |
3942
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:latest
4043
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:${{ env.VERSION }}

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "*.*.*"
9+
10+
jobs:
11+
ci:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Login to Dockerhub
18+
uses: docker/login-action@v1
19+
with:
20+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
21+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
22+
23+
- name: Setup Docker Buildx
24+
uses: docker/setup-buildx-action@v1
25+
26+
- name: Set Version
27+
run: |
28+
TAG=${GITHUB_REF#refs/tags/}
29+
echo "VERSION=$TAG" >> $GITHUB_ENV
30+
echo "APP_VERSION=$(echo $TAG | cut -d'-' -f 1)" >> $GITHUB_ENV
31+
32+
- name: Build and Push
33+
uses: docker/build-push-action@v2
34+
with:
35+
context: .
36+
file: ./Dockerfile
37+
builder: ${{ steps.buildx.outputs.name }}
38+
push: true
39+
build-args: VERSION=${{ env.APP_VERSION }}
40+
tags: |
41+
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:latest
42+
${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:${{ env.VERSION }}
43+
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:buildcache
44+
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/multi-downloader-nx:buildcache,mode=max

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.18
1+
2.0.18-d0

0 commit comments

Comments
 (0)