Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
96 changes: 96 additions & 0 deletions .github/workflows/docker-publish-ghcr-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Docker build dev on ghcr

on:
push:
branches: [ "dev" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# REGISTRY: "docker.io"
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}



jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
# username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
tags: |
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
type=raw,value=${{ env.GITHUB_HEAD_REF }}


# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max


createPullRequest:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
with:
ref: latest

- name: Reset dev branch
run: |
git fetch origin dev:dev
git reset --hard dev

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: dev

80 changes: 80 additions & 0 deletions .github/workflows/docker-publish-ghcr-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Docker build latest on ghcr

on:
schedule:
- cron: '1 1 1 * *'
push:
branches: [ "latest" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# REGISTRY: "docker.io"
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
# username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
tags: |
type=ref,enable=true,priority=600,prefix=,suffix=,event=branch
type=raw,value=${{ env.GITHUB_HEAD_REF }}


# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: ./
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max