mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-17 01:23:39 -05:00
Fix CI workflows
This commit is contained in:
55
.github/actions/build-image.yml
vendored
55
.github/actions/build-image.yml
vendored
@@ -1,55 +0,0 @@
|
|||||||
name: Build Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
tags:
|
|
||||||
description: "Docker image tags"
|
|
||||||
required: true
|
|
||||||
secrets:
|
|
||||||
GITHUB_TOKEN:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Download binaries
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: .
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
ghcr.io/sergi0g/cup
|
|
||||||
tags: ${{ inputs.tags }}
|
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: sergi0g
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build and push image
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
51
.github/actions/build-image/action.yml
vendored
Normal file
51
.github/actions/build-image/action.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
name: Build Image
|
||||||
|
inputs:
|
||||||
|
tags:
|
||||||
|
description: "Docker image tags"
|
||||||
|
required: true
|
||||||
|
secrets:
|
||||||
|
GITHUB_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Download binaries
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: .
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
ghcr.io/sergi0g/cup
|
||||||
|
tags: ${{ inputs.tags }}
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: sergi0g
|
||||||
|
password: $GITHUB_TOKEN
|
||||||
|
|
||||||
|
- name: Build and push image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
cache-from: type=gha
|
||||||
|
cache-to: type=gha,mode=max
|
||||||
9
.github/workflows/nightly.yml
vendored
9
.github/workflows/nightly.yml
vendored
@@ -65,10 +65,13 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- get-tag
|
- get-tag
|
||||||
- build-binaries
|
- build-binaries
|
||||||
uses: ./.github/actions/build-image.yml
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: ./.github/actions/build-image
|
||||||
with:
|
with:
|
||||||
tags: ${{ needs.get-tag.outputs.tag }}
|
tags: |
|
||||||
secrets:
|
${{ needs.get-tag.outputs.tag }}
|
||||||
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
nightly-release:
|
nightly-release:
|
||||||
|
|||||||
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -63,12 +63,14 @@ jobs:
|
|||||||
needs:
|
needs:
|
||||||
- get-tag
|
- get-tag
|
||||||
- build-binaries
|
- build-binaries
|
||||||
uses: ./.github/actions/build-image.yml
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: ./.github/actions/build-image
|
||||||
with:
|
with:
|
||||||
tags: |
|
tags: |
|
||||||
${{ needs.get-tag.outputs.tag }}
|
${{ needs.get-tag.outputs.tag }}
|
||||||
latest
|
latest
|
||||||
secrets:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
release:
|
release:
|
||||||
|
|||||||
Reference in New Issue
Block a user