feat: add builds

This commit is contained in:
Tom Andrade 2022-05-18 13:42:21 +02:00
parent 1982e6e731
commit 6ac306e327
Signed by: wolvie
GPG Key ID: 31AAB07872E82669
2 changed files with 42 additions and 0 deletions

21
.github/workflows/build-on-branch.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Build tag
on:
push:
branches:
- 'main'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: docker build . -t tandrade/short:$(echo $([[ $(git rev-parse --abbrev-ref HEAD) == master ]] && echo latest || echo latest-modsec))
- name: Login
uses: docker/login-action@v1.10.0
with:
username: tandrade
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push
run: docker push tandrade/short:$(echo $([[ $(git rev-parse --abbrev-ref HEAD) == master ]] && echo latest || echo latest-modsec))

21
.github/workflows/build-on-tag.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Build tag
on:
create:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: docker build . -t tandrade/short:${GITHUB_REF/refs\/tags\//}
- name: Login
uses: docker/login-action@v1.10.0
with:
username: tandrade
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Push
run: docker push tandrade/short:${GITHUB_REF/refs\/tags\//}