Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add workflows to push, pull, and validate docker images #1676

Merged
merged 34 commits into from
Jul 25, 2023
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f395322
add GitHub Action workflow for Docker deploy
nasdf Jul 20, 2023
9ddc073
temporarily run on push
nasdf Jul 21, 2023
96881df
update workflow triggers
nasdf Jul 21, 2023
5e2bdfc
temporarily use pull_request_target in workflow
nasdf Jul 21, 2023
d5569e7
add types edited to pull_request_target
nasdf Jul 21, 2023
fcce941
update workflow triggers
nasdf Jul 21, 2023
7ee2a85
Merge branch 'develop' into nasdf/feat/ci-docker-deploy
nasdf Jul 21, 2023
495f6a6
revert to pull_request trigger
nasdf Jul 21, 2023
3fdf241
use file instead of path in docker/build-push-action step
nasdf Jul 21, 2023
0c4f58a
remove pull_request workflow trigger
nasdf Jul 21, 2023
6084321
remove push branch trigger
nasdf Jul 21, 2023
10bf160
workflow fixes
nasdf Jul 21, 2023
67d06f5
Merge branch 'develop' into nasdf/feat/ci-docker-deploy
nasdf Jul 24, 2023
ab98758
add wasmer build step to docker file
nasdf Jul 24, 2023
0386984
update workflow to test Docker image
nasdf Jul 24, 2023
841f0b8
remove pull_request workflow trigger
nasdf Jul 24, 2023
ceb8374
remove wasmer build from Dockerfile
nasdf Jul 24, 2023
735dd59
remove pull_request trigger
nasdf Jul 24, 2023
cd04f43
Merge branch 'develop' into nasdf/feat/ci-docker-deploy
nasdf Jul 24, 2023
766070f
add pull-docker-image and validate-containerfile workflows
nasdf Jul 24, 2023
a2a9c33
build docker for amd64 and arm64. update workflow to test both arm64 …
nasdf Jul 24, 2023
323a3bd
use buildx in docker workflows
nasdf Jul 24, 2023
d20cf4e
remove docker test from push workflow
nasdf Jul 24, 2023
78341c0
use matrix for docker test workflows
nasdf Jul 25, 2023
000e4f0
simplify pull docker test matrix
nasdf Jul 25, 2023
75926f7
remove unused env from push-docker-image-to-registries workflow
nasdf Jul 25, 2023
45ef91f
add workflow dispatch
nasdf Jul 25, 2023
3d24a72
revert Docker platforms workflows
nasdf Jul 25, 2023
6554ba6
trigger pull-docker-image on pr
nasdf Jul 25, 2023
a6e8f89
update pull-docker-image tag
nasdf Jul 25, 2023
4eab4d2
remove test workflow triggers
nasdf Jul 25, 2023
e2054de
Merge branch 'develop' into nasdf/feat/ci-docker-deploy
nasdf Jul 25, 2023
3ab9289
set push-docker workflow trigger to push
nasdf Jul 25, 2023
d30d761
fix push-docker-image-to-registries job name
nasdf Jul 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/build-then-deploy-docker.yml
nasdf marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright 2023 Democratized Data Foundation
#
# Use of this software is governed by the Business Source License
# included in the file licenses/BSL.txt.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0, included in the file
# licenses/APL.txt.

# This workflow builds a Docker container image, if the build is successful
# then it will deploy the image to DockerHub & GitHub container registries.
name: Build Then Deploy Docker Workflow
nasdf marked this conversation as resolved.
Show resolved Hide resolved

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
push-to-registries:
name: Push Docker image to multiple registries
nasdf marked this conversation as resolved.
Show resolved Hide resolved

runs-on: ubuntu-latest

permissions:
packages: write
contents: read

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
sourcenetwork/defradb
ghcr.io/${{ github.repository }}

- name: Build and push Docker images
nasdf marked this conversation as resolved.
Show resolved Hide resolved
uses: docker/build-push-action@v4
nasdf marked this conversation as resolved.
Show resolved Hide resolved
with:
context: .
path: tools/defradb.containerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Loading