ci: publish build archives to release for bare metal installs (#4535)
Co-authored-by: Meier Lukas <meierschlumpf@gmail.com>
This commit is contained in:
43
.github/actions/extract-build-artifact/action.yaml
vendored
Normal file
43
.github/actions/extract-build-artifact/action.yaml
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
name: Extract Build Artifact
|
||||
description: Extracts artifacts from an existing Docker image to be used for from source installation
|
||||
inputs:
|
||||
digest:
|
||||
description: Digest of Docker image to use
|
||||
required: true
|
||||
architecture:
|
||||
description: Name of architecture, will be used to create directories (e.g. amd64, arm64)
|
||||
required: true
|
||||
release-tag:
|
||||
description: Tag of the release to which the artifact will be attached
|
||||
required: true
|
||||
repository:
|
||||
description: Repository to which the release belongs, e.g. owner/repo
|
||||
required: true
|
||||
token:
|
||||
description: GitHub token with permissions to upload release assets
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Start docker container for ${{ inputs.architecture }}
|
||||
run: |
|
||||
docker run --name homarr \
|
||||
-e "SECRET_ENCRYPTION_KEY=0000000000000000000000000000000000000000000000000000000000000000" \
|
||||
--detach --rm ${{ inputs.digest }}
|
||||
shell: bash
|
||||
- name: Extract build from ${{ inputs.architecture }} container
|
||||
run: |
|
||||
docker exec homarr cp /etc/nginx/templates/nginx.conf /app && \
|
||||
docker exec homarr tar -czf extraction.tar.gz -C /app . && \
|
||||
mkdir -p ${{ runner.temp }}/extraction/${{ inputs.architecture }} && \
|
||||
docker cp homarr:/app/extraction.tar.gz ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-${{ inputs.architecture }}.tar.gz
|
||||
shell: bash
|
||||
- name: Stop ${{ inputs.architecture }} container
|
||||
if: always()
|
||||
run: docker container remove --force --volumes homarr
|
||||
shell: bash
|
||||
- name: Add build archive to release
|
||||
env:
|
||||
GH_TOKEN: ${{ inputs.token }}
|
||||
run: gh release upload --repo ${{ inputs.repository }} ${{ inputs.release-tag }} ${{ runner.temp }}/extraction/${{ inputs.architecture }}/build-${{ inputs.architecture }}.tar.gz --clobber
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user