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