Skip to content

Commit

Permalink
Merge pull request #12 from wireapp/quay_pipelines
Browse files Browse the repository at this point in the history
add quay pipelines
  • Loading branch information
LukasForst authored Aug 13, 2021
2 parents b06f532 + a425ee3 commit 9b317bc
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 1 deletion.
52 changes: 51 additions & 1 deletion .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release Pipeline

on:
release:
types: published
types: [ published ]

env:
DOCKER_IMAGE: wire-bot/poll
Expand Down Expand Up @@ -129,3 +129,53 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_RELEASE }}
# Notify every release
if: always()

quay_publish:
name: Quay Publish Pipeline
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set Release Version
# use latest tag as release version
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV

# extract metadata for labels https://github.com/crazy-max/ghaction-docker-meta
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: quay.io/wire/poll-bot

# setup docker actions https://github.com/docker/build-push-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# login to GCR repo
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true
build-args: |
release_version=${{ env.RELEASE_VERSION }}
# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
with:
status: ${{ job.status }}
author_name: ${{ env.SERVICE_NAME }} Quay Production Publish
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_RELEASE }}
# Send message only if previous step failed
if: always()
55 changes: 55 additions & 0 deletions .github/workflows/quay.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Quay Deployment

on:
# manual dispatch
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag.'
required: true
jobs:
publish:
name: Deploy to staging
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2

# extract metadata for labels https://github.com/crazy-max/ghaction-docker-meta
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: quay.io/wire/poll-bot

# setup docker actions https://github.com/docker/build-push-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# login to GCR repo
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
tags: quay.io/wire/poll-bot:${{ github.event.inputs.tag }}
labels: ${{ steps.docker_meta.outputs.labels }}
push: true
build-args: |
release_version=${{ github.event.inputs.tag }}
# Send webhook to Wire using Slack Bot
- name: Webhook to Wire
uses: 8398a7/action-slack@v2
with:
status: ${{ job.status }}
author_name: Poll Bot Quay Custom Tag Pipeline
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_CI }}
# Send message only if previous step failed
if: always()

0 comments on commit 9b317bc

Please sign in to comment.