feature: replace Docker with Buildah in CI

This commit is contained in:
Ahmad Husen
2022-02-02 11:03:05 +07:00
parent 863b0d9617
commit 7926f4fb39
3 changed files with 31 additions and 24 deletions
+28 -22
View File
@@ -42,7 +42,7 @@ jobs:
git diff .SRCINFO git diff .SRCINFO
publish: publish:
name: Publish container image name: Publish OCI image
needs: pretest needs: pretest
if: github.event_name != 'pull_request' if: github.event_name != 'pull_request'
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -51,8 +51,15 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2.4.0 uses: actions/checkout@v2.4.0
- name: OCI meta - name: Log in to ghcr.io
id: meta uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: OCI metadata
id: metadata
uses: docker/metadata-action@v3 uses: docker/metadata-action@v3
with: with:
images: ghcr.io/${{ github.repository }} images: ghcr.io/${{ github.repository }}
@@ -64,29 +71,28 @@ jobs:
type=semver,pattern={{major}} type=semver,pattern={{major}}
type=sha type=sha
- name: Set up QEMU - name: Build image
uses: docker/setup-qemu-action@v1 id: build
uses: redhat-actions/buildah-build@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with: with:
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
containerfiles: |
./Dockerfile
extra-args: |
--pull
- name: Push to ghcr.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io registry: ghcr.io
username: ${{ github.repository_owner }} extra-args: |
password: ${{ secrets.GITHUB_TOKEN }} --disable-content-trust
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
test: test:
name: Test (with prebuilt Container Image) name: Test (with prebuilt OCI Image)
needs: publish needs: publish
runs-on: ubuntu-latest runs-on: ubuntu-latest
+1
View File
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Move repo from datakrama to hapakaien - Move repo from datakrama to hapakaien
- `builder` user is added to sudoers directly instead of via the wheel group - `builder` user is added to sudoers directly instead of via the wheel group
- Replace Docker with Buildah in CI
### Fixed ### Fixed
+2 -2
View File
@@ -1,7 +1,7 @@
# https://help.github.com/en/articles/metadata-syntax-for-github-actions # https://help.github.com/en/articles/metadata-syntax-for-github-actions
name: "Arch Linux's package action" name: "Arch Linux's package action"
description: "GitHub Action to run Arch Linux's package tools" description: "GitHub Action to run Arch Linux's package tools"
author: 'datakrama' author: 'hapakaien'
branding: branding:
icon: 'package' icon: 'package'
color: 'blue' color: 'blue'
@@ -38,7 +38,7 @@ inputs:
runs: runs:
using: 'docker' using: 'docker'
image: 'docker://ghcr.io/datakrama/archlinux-package-action:1' image: 'docker://ghcr.io/hapakaien/archlinux-package-action:1'
args: args:
- ${{ inputs.path }} - ${{ inputs.path }}
- ${{ inputs.pkgver }} - ${{ inputs.pkgver }}