Merge pull request #1747 from dexidp/docker-build

Add docker build and push to docker hub
This commit is contained in:
Márk Sági-Kazár 2020-07-01 13:55:53 +02:00 committed by GitHub
commit 5160c659c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 50 additions and 0 deletions

View file

@ -81,3 +81,29 @@ jobs:
# Ensure proto generation doesn't depend on external packages. # Ensure proto generation doesn't depend on external packages.
- name: Verify proto - name: Verify proto
run: make verify-proto run: make verify-proto
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Determine tag
uses: haya14busa/action-cond@v1
id: imagetag
with:
cond: ${{ github.event_name == 'pull_request' }}
if_true: ${{ github.sha }}
if_false: "master"
- name: Build
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: dexidp/dex
tags: ${{ steps.imagetag.outputs.value }}
add_git_labels: true
push: ${{ github.event_name == 'push' }}

24
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
docker:
name: Docker
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build and push image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: dexidp/dex
tags: latest
tag_with_ref: true
add_git_labels: true