autodeploy dockerhub

This commit is contained in:
Pierre Dubouilh 2021-11-12 11:29:41 +01:00 committed by Pierre Dubouilh
parent de632f9ab7
commit cb4631c086
2 changed files with 31 additions and 1 deletions

View file

@ -1,7 +1,6 @@
name: ci
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
@ -20,3 +19,4 @@ jobs:
- name: Run
run: make test

30
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: deploy
on:
push:
branches: [ master ]
push:
tags:
- '*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
with:
submodules: true
- name: Set env
run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV
- name: docker
env:
DOCKER_USER: ${{secrets.DOCKER_USER}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
run: |
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
docker build -t pldubouilh/gossa:latest -t pldubouilh/gossa:$GIT_TAG -f support/build.Dockerfile .
docker push pldubouilh/gossa:latest
docker push pldubouilh/gossa:$GIT_TAG