Skip to content

Commit e578d4d

Browse files
authored
Merge pull request #48 from migalabs/feature/support-multiple-val-formats
Add action to push to docker on each new release
2 parents 7c68e5a + 1017010 commit e578d4d

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
if: startsWith(github.ref, 'refs/tags')
10+
steps:
11+
- name: Extract Version
12+
id: version_step
13+
run: |
14+
echo "##[set-output name=version;]VERSION=${GITHUB_REF#$"refs/tags/v"}"
15+
echo "##[set-output name=version_tag;]$GITHUB_REPOSITORY:${GITHUB_REF#$"refs/tags/v"}"
16+
echo "##[set-output name=latest_tag;]$GITHUB_REPOSITORY:latest"
17+
- name: Print Version
18+
run: |
19+
echo ${{steps.version_step.outputs.version_tag}}
20+
echo ${{steps.version_step.outputs.latest_tag}}
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v1
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v1
26+
27+
- name: Login to DockerHub
28+
uses: docker/login-action@v1
29+
with:
30+
username: ${{ secrets.DOCKERHUB_USERNAME }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
32+
33+
- name: PrepareReg Names
34+
id: read-docker-image-identifiers
35+
run: |
36+
echo VERSION_TAG=$(echo ${{ steps.version_step.outputs.version_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
37+
echo LASTEST_TAG=$(echo ${{ steps.version_step.outputs.latest_tag }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
38+
- name: Build and push
39+
id: docker_build
40+
uses: docker/build-push-action@v2
41+
with:
42+
push: true
43+
tags: |
44+
${{env.VERSION_TAG}}
45+
${{env.LASTEST_TAG}}
46+
build-args: |
47+
${{steps.version_step.outputs.version}}

0 commit comments

Comments
 (0)