From ae1b695fc53b3b5ac2cd02202ff5fe44343a18df Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 16 Feb 2023 14:21:36 -0500 Subject: [PATCH] feat: build digitalocean images in ci on release While these don't (yet?) get submitted to the Digitalocean marketplace, it should bring us most of the way of making that possible. The next step would be to somehow get notifications of the new image snapshot sent... Somewhere and have the lovely DO folks test/release it for us. --- .github/workflows/release.yml | 33 +++++++++++++++++++++++++++++++++ package.mk | 5 +++++ 2 files changed, 38 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edc508e81..a4a211334 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,6 +72,39 @@ jobs: name: build path: build + build-digitalocean: + name: build-digitalocean + runs-on: ubuntu-20.04 + needs: release + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup packer + uses: hashicorp/setup-packer@main + with: + version: latest + + - name: Run packer init + run: "make image/init/digitalocean" + + - name: Run `packer validate` + env: + PKR_VAR_dokku_version: ${{ needs.release.outputs.version }} + run: "make image/validate/digitalocean" + + - name: Bump Digitalocean Image + env: + DIGITALOCEAN_TOKEN: ${{ secrets.DIGITALOCEAN_TOKEN }} + PKR_VAR_dokku_version: ${{ needs.release.outputs.version }} + run: "make image/build/digitalocean" + + - name: upload packages + uses: actions/upload-artifact@v3 + with: + name: digitalocean-manifest.json + path: digitalocean-manifest.json + bump-azure: name: bump-azure runs-on: ubuntu-20.04 diff --git a/package.mk b/package.mk index dbd31493b..8a92a3393 100644 --- a/package.mk +++ b/package.mk @@ -35,6 +35,11 @@ ifdef DOKKU_GIT_REV else git rev-parse HEAD > /tmp/build-dokku/var/lib/dokku/GIT_REV endif + +.PHONY: image/build/digitalocean +image/build/digitalocean: + packer build -var 'dokku_version=${PKR_VAR_dokku_version}' contrib/images/digitalocean/packer.pkr.hcl + .PHONY: image/init/digitalocean image/init/digitalocean: packer init contrib/images/digitalocean/packer.pkr.hcl