|
| 1 | +name: Build Image |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: [ '*' ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + |
| 9 | +env: |
| 10 | + REGISTRY: ghcr.io |
| 11 | + IMAGE_NAME: linux-surface/grub-aarch64 |
| 12 | + |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-grub: |
| 16 | + name: Build GRUB Container |
| 17 | + |
| 18 | + runs-on: ubuntu-latest |
| 19 | + permissions: |
| 20 | + contents: read |
| 21 | + packages: write |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout repository |
| 25 | + uses: actions/checkout@v3 |
| 26 | + |
| 27 | + - name: Setup Docker buildx |
| 28 | + uses: docker/setup-buildx-action@v1 |
| 29 | + |
| 30 | + - name: Log into registry ${{ env.REGISTRY }} |
| 31 | + if: github.event_name != 'pull_request' |
| 32 | + uses: docker/login-action@v1 |
| 33 | + with: |
| 34 | + registry: ${{ env.REGISTRY }} |
| 35 | + username: ${{ github.actor }} |
| 36 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + |
| 38 | + - name: Extract Docker metadata |
| 39 | + id: meta |
| 40 | + uses: docker/metadata-action@v3 |
| 41 | + with: |
| 42 | + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} |
| 43 | + |
| 44 | + - name: Build and push Docker image |
| 45 | + id: build-and-push |
| 46 | + uses: docker/build-push-action@v2 |
| 47 | + with: |
| 48 | + context: . |
| 49 | + push: ${{ github.event_name != 'pull_request' }} |
| 50 | + tags: ${{ steps.meta.outputs.tags }} |
| 51 | + labels: ${{ steps.meta.outputs.labels }} |
| 52 | + |
| 53 | + |
| 54 | + build-image: |
| 55 | + name: Build GRUB AArch64 Image |
| 56 | + |
| 57 | + if: ${{ github.event_name != 'pull_request' }} |
| 58 | + needs: [build-grub] |
| 59 | + |
| 60 | + runs-on: ubuntu-latest |
| 61 | + |
| 62 | + steps: |
| 63 | + - name: Checkout repository |
| 64 | + uses: actions/checkout@v3 |
| 65 | + |
| 66 | + - name: Build GRUB AArch64 Image |
| 67 | + run: | |
| 68 | + docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} |
| 69 | + docker run --rm -v "${PWD}/":/output \ |
| 70 | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} \ |
| 71 | + aarch64-grub-mkimage \ |
| 72 | + -O arm64-efi \ |
| 73 | + -o /output/bootaa64.efi \ |
| 74 | + --prefix= \ |
| 75 | + $(cat modules.txt) |
| 76 | + |
| 77 | + - name: Publish Release |
| 78 | + uses: svenstaro/upload-release-action@v2 |
| 79 | + with: |
| 80 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 81 | + file: bootaa64.efi |
| 82 | + tag: ${{ github.ref }} |
0 commit comments