Skip to content

Commit

Permalink
Fix S3 wrong mime-type of the .qcow2 image file
Browse files Browse the repository at this point in the history
Use s3cmd for uploading the pre-built images, to fix the previous action
wrong mime-type.
  • Loading branch information
DavidePrincipi committed Oct 23, 2024
1 parent b3608c7 commit 0230168
Showing 1 changed file with 18 additions and 30 deletions.
48 changes: 18 additions & 30 deletions .github/workflows/build-disk-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ jobs:
- qemu.rl
needs:
- core-version
env:
DO_SPACE_NAME: 'ns8'
DO_SPACE_REGION: 'ams3'
if: needs.core-version.outputs.is_stable == 'true'
steps:
- name: Setup s3cmd
uses: s3-actions/[email protected]
with:
access_key: ${{ secrets.DO_SPACE_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SPACE_SECRET_KEY }}
- name: Setup `packer`
uses: hashicorp/setup-packer@main
- uses: actions/checkout@v4
Expand Down Expand Up @@ -71,30 +73,16 @@ jobs:
cd $(dirname ${{ steps.qcow2.outputs.path }})
sha256sum $(basename ${{ steps.qcow2.outputs.path }}) > ../CHECKSUM
sha256sum $(basename ${{ steps.vmdk.outputs.path }}) >> ../CHECKSUM
- name: Upload qcow2 NS8 image
uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.DO_SPACE_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SPACE_SECRET_KEY }}
space_name: ${{ env.DO_SPACE_NAME }}
space_region: ${{ env.DO_SPACE_REGION }}
source: ${{ steps.qcow2.outputs.path }}
out_dir: ns8-images
- name: Upload vmdk NS8 image
uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.DO_SPACE_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SPACE_SECRET_KEY }}
space_name: ${{ env.DO_SPACE_NAME }}
space_region: ${{ env.DO_SPACE_REGION }}
source: ${{ steps.vmdk.outputs.path }}
out_dir: ns8-images
- name: Upload checksum
uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ secrets.DO_SPACE_ACCESS_KEY }}
secret_key: ${{ secrets.DO_SPACE_SECRET_KEY }}
space_name: ${{ env.DO_SPACE_NAME }}
space_region: ${{ env.DO_SPACE_REGION }}
source: CHECKSUM
out_dir: ns8-images
- name: Upload images with s3cmd
run: >
s3cmd put
--host ams3.digitaloceanspaces.com
--verbose
--progress
--acl-public
--guess-mime-type
--mime-type=application/octet-stream
${{ steps.qcow2.outputs.path }}
${{ steps.vmdk.outputs.path }}
CHECKSUM
s3://ns8/ns8-images

0 comments on commit 0230168

Please sign in to comment.