disable push to github docker repository from main

This commit is contained in:
Adil Hafeez 2025-10-03 12:19:38 -07:00
parent 03d8cc1894
commit c6c8119936
2 changed files with 153 additions and 153 deletions

View file

@ -1,88 +1,88 @@
name: Publish docker image to ghcr (latest)
# name: Publish docker image to ghcr (latest)
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/archgw
# env:
# IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/archgw
on:
push:
branches: [main]
# on:
# push:
# branches: [main]
jobs:
build-arm64:
runs-on: [linux-arm64]
permissions: { contents: read, packages: write }
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# jobs:
# build-arm64:
# runs-on: [linux-arm64]
# permissions: { contents: read, packages: write }
# steps:
# - uses: actions/checkout@v4
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=latest
- name: Build and Push ARM64 Image
uses: docker/build-push-action@v5
with:
context: .
file: ./arch/Dockerfile
platforms: linux/arm64
push: true
# produce ghcr.io/<owner>/archgw:latest-arm64
tags: ${{ steps.meta.outputs.tags }}-arm64
# - name: Build and Push ARM64 Image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./arch/Dockerfile
# platforms: linux/arm64
# push: true
# # produce ghcr.io/<owner>/archgw:latest-arm64
# tags: ${{ steps.meta.outputs.tags }}-arm64
build-amd64:
runs-on: ubuntu-latest
permissions: { contents: read, packages: write }
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# build-amd64:
# runs-on: ubuntu-latest
# permissions: { contents: read, packages: write }
# steps:
# - uses: actions/checkout@v4
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=latest
- name: Build and Push AMD64 Image
uses: docker/build-push-action@v5
with:
context: .
file: ./arch/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}-amd64
# - name: Build and Push AMD64 Image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./arch/Dockerfile
# platforms: linux/amd64
# push: true
# tags: ${{ steps.meta.outputs.tags }}-amd64
create-manifest:
runs-on: ubuntu-latest
needs: [build-arm64, build-amd64]
permissions: { contents: read, packages: write }
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# create-manifest:
# runs-on: ubuntu-latest
# needs: [build-arm64, build-amd64]
# permissions: { contents: read, packages: write }
# steps:
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value=latest
- name: Create Multi-Arch Manifest
run: |
docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
${{ env.IMAGE_NAME }}:latest-arm64 \
${{ env.IMAGE_NAME }}:latest-amd64
# - name: Create Multi-Arch Manifest
# run: |
# docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
# ${{ env.IMAGE_NAME }}:latest-arm64 \
# ${{ env.IMAGE_NAME }}:latest-amd64

View file

@ -1,87 +1,87 @@
name: release - publish docker image to ghcr (latest)
# name: release - publish docker image to ghcr (latest)
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/archgw
# env:
# IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/archgw
on:
release:
types: [published]
# on:
# release:
# types: [published]
jobs:
build-arm64:
runs-on: [linux-arm64]
permissions: { contents: read, packages: write }
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# jobs:
# build-arm64:
# runs-on: [linux-arm64]
# permissions: { contents: read, packages: write }
# steps:
# - uses: actions/checkout@v4
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{tag}}
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value={{tag}}
- name: Build and Push ARM64 Image
uses: docker/build-push-action@v5
with:
context: .
file: ./arch/Dockerfile
platforms: linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}-arm64
# - name: Build and Push ARM64 Image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./arch/Dockerfile
# platforms: linux/arm64
# push: true
# tags: ${{ steps.meta.outputs.tags }}-arm64
build-amd64:
runs-on: ubuntu-latest
permissions: { contents: read, packages: write }
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# build-amd64:
# runs-on: ubuntu-latest
# permissions: { contents: read, packages: write }
# steps:
# - uses: actions/checkout@v4
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{tag}}
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value={{tag}}
- name: Build and Push AMD64 Image
uses: docker/build-push-action@v5
with:
context: .
file: ./arch/Dockerfile
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}-amd64
# - name: Build and Push AMD64 Image
# uses: docker/build-push-action@v5
# with:
# context: .
# file: ./arch/Dockerfile
# platforms: linux/amd64
# push: true
# tags: ${{ steps.meta.outputs.tags }}-amd64
create-manifest:
runs-on: ubuntu-latest
needs: [build-arm64, build-amd64]
permissions: { contents: read, packages: write }
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# create-manifest:
# runs-on: ubuntu-latest
# needs: [build-arm64, build-amd64]
# permissions: { contents: read, packages: write }
# steps:
# - uses: docker/login-action@v3
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value={{tag}}
# - id: meta
# uses: docker/metadata-action@v5
# with:
# images: ${{ env.IMAGE_NAME }}
# tags: |
# type=raw,value={{tag}}
- name: Create Multi-Arch Manifest
run: |
docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
${{ steps.meta.outputs.tags }}-arm64 \
${{ steps.meta.outputs.tags }}-amd64
# - name: Create Multi-Arch Manifest
# run: |
# docker buildx imagetools create -t ${{ steps.meta.outputs.tags }} \
# ${{ steps.meta.outputs.tags }}-arm64 \
# ${{ steps.meta.outputs.tags }}-amd64