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

Update Docker image build pipelines #990

Merged
merged 13 commits into from
Nov 10, 2022
43 changes: 43 additions & 0 deletions .github/workflows/amd64-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "amd64-docker-build"

on:
push:
branches:
- "**"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker-build:
runs-on: "ubuntu-latest"
permissions:
contents: write
packages: write
steps:
- uses: "actions/checkout@v3"
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile
88 changes: 0 additions & 88 deletions .github/workflows/docker-build.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/main-docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "main-docker-build"

on:
push:
branches:
- main
tags:
- "v*"
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
docker-build:
runs-on: "ubuntu-latest"
permissions:
contents: write
packages: write
steps:
- uses: "actions/checkout@v3"
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=semver,pattern={{version}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
platforms: linux/arm64, linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
file: Dockerfile