mirror of
https://github.com/pawelmalak/flame.git
synced 2025-04-23 13:27:21 -04: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 }}
|
29
.github/workflows/docker-image.yml
vendored
29
.github/workflows/docker-image.yml
vendored
|
@ -26,24 +26,12 @@ jobs:
|
|||
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${{ steps.date.outputs.date }}"
|
||||
echo ${TAGS}
|
||||
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
|
||||
uses: docker/setup-qemu-action@v1
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
|
@ -53,18 +41,9 @@ jobs:
|
|||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push to GitHub Packages
|
||||
uses: docker/build-push-action@v2
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./.docker/Dockerfile
|
||||
push: true
|
||||
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 }}
|
||||
tags: ${{ steps.prep.outputs.tags }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue