Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonN3 committed Feb 18, 2024
1 parent c48c281 commit 96b1379
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 79 deletions.
73 changes: 18 additions & 55 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@ on:
pull_request:
branches:
- main
paths:
- 'Dockerfile'
push:
branches:
- main
paths:
- 'Dockerfile'
workflow_dispatch:

env:
IMAGE_NAME: isogenerator
Expand All @@ -24,55 +19,23 @@ jobs:
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
version:
- 38
- 39
- 40
include:
- version: 39
support: latest
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
uses: actions/checkout@v3

# Build metadata
- name: Image Metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
org.opencontainers.image.description=A container image for generating Universal Blue ISO files
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
# set latest tag for default branch
type=raw,value=latest,enable={{is_default_branch}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- name: Build image
uses: JasonN3/build-action@action
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}

check:
name: Check build successful
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [push-image]
steps:
- name: Exit on failure
if: ${{ needs.push-image.result == 'failure' || needs.push-image.result == 'skipped' }}
shell: bash
run: exit 1
- name: Exit
shell: bash
run: exit 0
image_name: isogenerator
image_variant: main
version: ${{ matrix.version }}
support: ${{ matrix.support }}
signing_key: ${{ secrets.SIGNING_SECRET }}
continue-on-error: false
29 changes: 15 additions & 14 deletions .github/workflows/test-iso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ name: Test Generate ISO
on:
push:
branches:
- 'main'
- main
tags:
- 'v*'
paths-ignore:
- 'Containerfile'
- '*.md'
- 'LICENSE'
- 'CODEOWNERS'
pull_request:

env:
ARCH: ${{ inputs.ARCH || 'x86_64' }}
IMAGE_NAME: ${{ inputs.IMAGE_NAME || 'base-main' }}
IMAGE_REPO: ${{ inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }}
IMAGE_TAG: ${{ inputs.IMAGE_TAG || 'latest' }}
VARIANT: ${{ inputs.VARIANT || 'Kinoite' }}
VERSION: ${{ inputs.VERSION || '39' }}
WEB_UI: ${{ inputs.WEB_UI || 'false' }}
CURR_REPO: ${{ inputs.BUILD_REPO || github.repository }}
CURR_REF: ${{ inputs.BUILD_REF || github.ref }}
branches:
- main
paths-ignore:
- 'Containerfile'
- '*.md'
- 'LICENSE'
- 'CODEOWNERS'

jobs:
build-and-push-iso:
Expand All @@ -39,5 +40,5 @@ jobs:
VARIANT: 'Kinoite'
VERSION: '39'
WEB_UI: 'false'
CURR_REPO: ${{ github.repository }}
CURR_REF: ${{ github.ref }}
ACTION_REPO: ${{ github.repository }}
ACTION_REF: ${{ github.ref }}
8 changes: 4 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
ARG version=39
ARG VERSION=39

FROM fedora:${version}
FROM fedora:${VERSION}

ENV ARCH="x86_64"
ENV IMAGE_NAME="base-main"
ENV IMAGE_REPO="ghcr.io/ublue-os"
ENV IMAGE_TAG="${version}"
ENV IMAGE_TAG="${VERSION}"
ENV VARIANT="Kinoite"
ENV VERSION="${version}"
ENV VERSION="${VERSION}"
ENV WEB_UI="false"

COPY / /isogenerator
Expand Down
12 changes: 6 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ inputs:
description: Enable Anaconda WebUI
required: true
default: "false"
BUILD_REPO:
description: Repository with the build tool
ACTION_REPO:
description: Repository with the build action
required: false
default: ${{ github.repository }}
BUILD_REF:
description: Repository ref for the build tool
ACTION_REF:
description: Repository ref for the build action
required: false
default: ${{ github.ref }}

Expand All @@ -49,8 +49,8 @@ runs:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.BUILD_REPO }}
ref: ${{ inputs.BUILD_REF }}
repository: ${{ inputs.ACTION_REPO }}
ref: ${{ inputs.ACTION_REF }}
submodules: recursive

- name: Install dependencies
Expand Down

0 comments on commit 96b1379

Please sign in to comment.