Skip to content

Commit

Permalink
feat: Release to GHCR
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed Feb 10, 2024
1 parent 8fdc434 commit 293ba16
Show file tree
Hide file tree
Showing 2 changed files with 147 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
name: GHCR Developer image
on: # yamllint disable-line rule:truthy
push:
branches: [main]

jobs:
push-amd64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker - Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: type=raw,value=dev
flavor: latest=false

- name: Docker - Build / Push
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}

push-arm64:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker - Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: type=raw,value=dev-arm64
flavor: latest=false

- name: Docker - Build / Push
uses: docker/build-push-action@v5
with:
file: Dockerfile.arm64
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,41 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}

# Builds the Dockerfile and pushes it to GHCR
release-ghcr-amd64:
name: Release - GHCR Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker - Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
flavor: latest=true

- name: Docker - Build / Push
id: docker_build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}

# Builds the Dockerfile.arm64 and pushes it to dockerhub
release-arm64:
name: Release - Docker image
Expand Down Expand Up @@ -81,6 +116,49 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}

# Builds the Dockerfile.arm64 and pushes it to GHCR
release-ghcr-arm64:
name: Release - GHCR Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker - Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern=v{{version}}-arm64
type=semver,pattern=v{{major}}.{{minor}}-arm64
type=semver,pattern=v{{major}}-arm64
type=raw,value=latest-arm64
flavor: latest=false

- name: Docker - Build / Push
id: docker_build
uses: docker/build-push-action@v5
with:
file: Dockerfile.arm64
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}

# Generates a new release specifically for the helm chart, using the helm charts version
# Only generates a new release if the helm charts version has changed since the last release
# Will then update the gh-pages branch & helm repository
Expand Down

0 comments on commit 293ba16

Please sign in to comment.