Skip to content

Commit

Permalink
Set up automated build
Browse files Browse the repository at this point in the history
  • Loading branch information
qzed committed May 3, 2022
1 parent d08a3a9 commit 1f72cfc
Showing 1 changed file with 82 additions and 0 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Build Image

on:
push:
tags: [ '*' ]
pull_request:
branches: [ main ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: linux-surface/grub-aarch64


jobs:
build-grub:
name: Build GRUB Container

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v1

- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}


build-image:
name: Build GRUB AArch64 Image

if: ${{ github.event_name != 'pull_request' }}
needs: [build-grub]

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build GRUB AArch64 Image
run: |
docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}
docker run --rm -v "${PWD}/":/output \
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} \
aarch64-grub-mkimage \
-O arm64-efi \
-o /output/bootaa64.efi \
--prefix= \
$(cat modules.txt)
- name: Publish Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: bootaa64.efi
tag: ${{ github.ref }}

0 comments on commit 1f72cfc

Please sign in to comment.