mirror of
https://github.com/sergi0g/cup.git
synced 2025-11-16 17:13:46 -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
|
||||
13
.github/workflows/nightly.yml
vendored
13
.github/workflows/nightly.yml
vendored
@@ -65,11 +65,14 @@ jobs:
|
||||
needs:
|
||||
- get-tag
|
||||
- build-binaries
|
||||
uses: ./.github/actions/build-image.yml
|
||||
with:
|
||||
tags: ${{ needs.get-tag.outputs.tag }}
|
||||
secrets:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: ./.github/actions/build-image
|
||||
with:
|
||||
tags: |
|
||||
${{ needs.get-tag.outputs.tag }}
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
nightly-release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -63,13 +63,15 @@ jobs:
|
||||
needs:
|
||||
- get-tag
|
||||
- build-binaries
|
||||
uses: ./.github/actions/build-image.yml
|
||||
with:
|
||||
tags: |
|
||||
${{ needs.get-tag.outputs.tag }}
|
||||
latest
|
||||
secrets:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: ./.github/actions/build-image
|
||||
with:
|
||||
tags: |
|
||||
${{ needs.get-tag.outputs.tag }}
|
||||
latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -89,4 +91,4 @@ jobs:
|
||||
prerelease: true
|
||||
tag_name: ${{ needs.get-tag.outputs.tag }}
|
||||
name: ${{ needs.get-tag.outputs.tag }}
|
||||
files: binaries/*
|
||||
files: binaries/*
|
||||
|
||||
Reference in New Issue
Block a user