diff --git a/.github/workflows/build_images.yml b/.github/workflows/build_images.yml index 5d65b22..a68171f 100644 --- a/.github/workflows/build_images.yml +++ b/.github/workflows/build_images.yml @@ -6,6 +6,9 @@ on: tag: required: true type: string + source: + required: false + default: amazon-ebs.aws-ami,digitalocean.do-marketplace secrets: github-token: required: true @@ -23,6 +26,7 @@ env: jobs: build-aws: runs-on: ubuntu-latest + if: ${{ contains(inputs.source, "amazon-ebs.aws-ami") }} steps: - name: Build AWS image uses: RocketChat/packer-configs@main @@ -70,6 +74,7 @@ jobs: build-digitalocean: runs-on: ubuntu-latest + if: ${{ contains(inputs.source, "digitalocean.do-marketplace") }} steps: - name: Build DigitalOcean image uses: RocketChat/packer-configs@main @@ -109,7 +114,7 @@ jobs: doctl compute droplet delete bats-${{ inputs.tag }} --force exit $status - create-release: + create-github-release: needs: - is-digitalocean-working - is-aws-working @@ -125,6 +130,11 @@ jobs: body: ${{ format('https://github.com/RocketChat/Rocket.Chat/releases/{0}', inputs.tag) }} draft: false + update-digitalocean-marketplace-listing: + needs: + - is-digitalocean-working + runs-on: ubuntu-latest + steps: - name: Update marketplace listing shell: bash env: diff --git a/.github/workflows/manual-build.yml b/.github/workflows/manual-build.yml index 9aa3b09..b1caca1 100644 --- a/.github/workflows/manual-build.yml +++ b/.github/workflows/manual-build.yml @@ -6,13 +6,38 @@ on: tag: type: string required: true + platform: + type: choice + options: + - AWS + - DigitalOcean + - Both jobs: + detect-source: + runs-on: ubuntu-latest + outputs: + source: ${{ steps._id.outputs.source }} + steps: + - id: _id + shell: bash + run: | + source= + case "${{ inputs.platform }}" in + "AWS") source="amazon-ebs.aws-ami" ;; + "DigitalOcean") source="digitalocean.do-marketplace" ;; + "Both") source="amazon-ebs.aws-ami,digitalocean.do-marketplace" ;; + esac + + echo "source: $source" + echo "source=$source" >> $GITHUB_OUTPUT do: uses: ./.github/workflows/build_images.yml + needs: [ detect-source ] with: tag: ${{ inputs.tag }} + source: ${{ needs.detect-source.outputs.source }} secrets: github-token: ${{ secrets.GH_TOKEN_PERSONAL }} digitalocean-token: ${{ secrets.DO_TOKEN }}