mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-21 20:39:36 +02:00
split multiarch action into its own separate action that does not run on PRs
This commit is contained in:
parent
cb9b2bee8e
commit
b12ff953ba
2 changed files with 52 additions and 25 deletions
48
.github/workflows/docker-image.multiarch.yml
vendored
Normal file
48
.github/workflows/docker-image.multiarch.yml
vendored
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
name: Docker Image CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ master ]
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Get current date
|
||||||
|
id: date
|
||||||
|
run: echo "date=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Check out the repo
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Prepare-multiarch
|
||||||
|
id: prep-multiarch
|
||||||
|
run: |
|
||||||
|
DOCKER_IMAGE=ghcr.io/${{ github.repository }}
|
||||||
|
VERSION=latest
|
||||||
|
if [[ '${{ github.head_ref }}' != '' ]]; then
|
||||||
|
VERSION=${{github.head_ref}}
|
||||||
|
fi
|
||||||
|
TAGS="${DOCKER_IMAGE}:${VERSION}-multiarch,${DOCKER_IMAGE}:${{ steps.date.outputs.date }}-multiarch"
|
||||||
|
echo ${TAGS}
|
||||||
|
echo "tags-multiarch=${TAGS}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push multiarch to GitHub Packages
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./.docker/Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.prep-multiarch.outputs.tags-multiarch }}
|
27
.github/workflows/docker-image.yml
vendored
27
.github/workflows/docker-image.yml
vendored
|
@ -27,23 +27,11 @@ jobs:
|
||||||
echo ${TAGS}
|
echo ${TAGS}
|
||||||
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
|
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Prepare-multiarch
|
|
||||||
id: prep-multiarch
|
|
||||||
run: |
|
|
||||||
DOCKER_IMAGE=ghcr.io/${{ github.repository }}
|
|
||||||
VERSION=latest
|
|
||||||
if [[ '${{ github.head_ref }}' != '' ]]; then
|
|
||||||
VERSION=${{github.head_ref}}
|
|
||||||
fi
|
|
||||||
TAGS="${DOCKER_IMAGE}:${VERSION}-multiarch,${DOCKER_IMAGE}:${{ steps.date.outputs.date }}-multiarch"
|
|
||||||
echo ${TAGS}
|
|
||||||
echo "tags-multiarch=${TAGS}" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
|
@ -53,18 +41,9 @@ jobs:
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Push to GitHub Packages
|
- name: Push to GitHub Packages
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./.docker/Dockerfile
|
file: ./.docker/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ steps.prep.outputs.tags }}
|
tags: ${{ steps.prep.outputs.tags }}
|
||||||
|
|
||||||
- name: Push multiarch to GitHub Packages
|
|
||||||
uses: docker/build-push-action@v2
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./.docker/Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.prep-multiarch.outputs.tags-multiarch }}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue