1
0
mirror of synced 2025-02-24 14:13:17 +01:00

72 lines
1.9 KiB
YAML
Raw Normal View History

2025-01-09 11:13:16 +00:00
name: Build and Release Lindbergh
on:
push:
branches:
2025-01-09 11:14:04 +00:00
- master
2025-01-09 11:13:16 +00:00
pull_request:
branches:
2025-01-09 11:14:04 +00:00
- master
2025-01-09 11:16:51 +00:00
permissions:
contents: write
jobs:
2025-01-09 11:26:02 +00:00
build-and-release:
runs-on: ubuntu-latest
2025-01-09 11:26:02 +00:00
steps:
2025-01-09 11:26:02 +00:00
# Checkout the repository
2025-01-09 11:13:16 +00:00
- name: Checkout repository
uses: actions/checkout@v3
2025-01-09 11:26:02 +00:00
# Set up Docker Buildx
2025-01-09 11:13:16 +00:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
2025-01-09 11:26:02 +00:00
# Build the Docker image
2025-01-09 11:13:16 +00:00
- name: Build Docker image
run: |
docker build --target lindbergh-build -t lindbergh-loader .
2025-01-09 11:30:00 +00:00
# Extract build artifacts
2025-01-09 11:20:01 +00:00
- name: Extract build artifacts
2025-01-09 11:13:16 +00:00
run: |
docker create --name lindbergh-builder lindbergh-loader
2025-01-09 11:20:01 +00:00
docker cp lindbergh-builder:/output ./build
2025-01-09 11:13:16 +00:00
docker rm lindbergh-builder
2025-01-09 11:34:34 +00:00
# Compress the build directory
- name: Compress build directory
run: tar -czvf build.tar.gz -C ./build .
# Archive the build directory as an artifact for debugging
2025-01-09 11:13:16 +00:00
- name: Archive build directory
uses: actions/upload-artifact@v3
with:
name: build-output
path: ./build
2025-01-09 11:30:00 +00:00
# Create a GitHub release and capture the upload URL
2025-01-09 11:13:16 +00:00
- name: Create Release
2025-01-09 11:34:34 +00:00
id: create_release
2025-01-09 11:13:16 +00:00
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}
2025-01-09 11:26:02 +00:00
release_name: "Build v${{ github.run_number }}"
2025-01-09 11:13:16 +00:00
draft: false
prerelease: false
2025-01-09 11:34:34 +00:00
# Upload the compressed build artifact to the release
2025-01-09 11:13:16 +00:00
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2025-01-09 11:13:16 +00:00
upload_url: ${{ steps.create_release.outputs.upload_url }}
2025-01-09 11:34:34 +00:00
asset_path: ./build.tar.gz
2025-01-09 11:13:16 +00:00
asset_name: build.tar.gz
asset_content_type: application/gzip