Skip to content

Commit

Permalink
fix: build pi image
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Apr 20, 2022
1 parent 893fffa commit be7ccdc
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/satellitepi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,43 @@ jobs:
sudo packer init satellitepi.pkr.hcl
sudo packer build --var branch=${GITHUB_REF_NAME} satellitepi.pkr.hcl
- name: rename image
- name: compress image
shell: bash
run: |
cd pi-image/output-satellitepi
sudo mv image satellitepi-test.img
# upload artifact
- name: Upload production artifacts
uses: actions/upload-artifact@v2
sudo apt-get install -y zerofree
device="$(sudo losetup --partscan --show --find image)"
sudo zerofree "${device}p2"
sudo losetup --detach "$device"
sudo gzip image
- name: Determine files to upload
id: filenames
shell: bash
run: |
HASH=$(git rev-parse --short HEAD)
COUNT=$(git rev-list --count HEAD)
VERSION=$(node -e "console.log(require('./package.json').version)")
echo ::set-output name=sourcename::"pi-image/output-satellitepi/image.gz"
echo ::set-output name=targetname::"companion-satellite-pi-${COUNT}-${HASH}.img.gz"
echo ::set-output name=longversion::"${VERSION}+${COUNT}-${HASH}"
- name: Upload build
uses: bitfocus/actions/upload-and-notify@main
with:
name: satellitepi
if-no-files-found: error
path: |
pi-image/output-satellitepi/*.img
long-version: ${{ steps.filenames.outputs.longversion }}
beta-branch: master

source-filename: ${{ steps.filenames.outputs.sourcename }}
destination-filename: ${{ steps.filenames.outputs.targetname }}
s3-host: ${{ secrets.S3_HOST }}
s3-bucket: ${{ secrets.S3_BUCKET }}/companion-satellite
s3-access-key: ${{ secrets.S3_KEY }}
s3-secret-key: ${{ secrets.S3_SECRET }}

api-product: companion-satellite
api-target: 'linux-img'
api-secret: ${{ secrets.BITFOCUS_API_PROJECT_SECRET }}

0 comments on commit be7ccdc

Please sign in to comment.