From 06b525cdc8989e6bb7f48d351a61b1dec8028991 Mon Sep 17 00:00:00 2001 From: alallema Date: Thu, 27 Apr 2023 17:38:46 +0200 Subject: [PATCH 1/3] Add aws build manual trigger --- .github/workflows/aws_publish.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 3 --- 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/aws_publish.yml diff --git a/.github/workflows/aws_publish.yml b/.github/workflows/aws_publish.yml new file mode 100644 index 0000000..08f61e0 --- /dev/null +++ b/.github/workflows/aws_publish.yml @@ -0,0 +1,30 @@ +name: Publish AWS + +on: + workflow_dispatch: + +env: + PACKER_VERSION: "latest" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + +jobs: + publishing: + name: publish-aws + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup `packer` + uses: hashicorp/setup-packer@main + with: + version: ${{ env.PACKER_VERSION }} + + - name: Run `packer init` + run: "packer init ." + + - name: Run `packer validate` + run: "packer validate ." + + - name: Run `packer build` + run: "packer build -only 'amazon-ebs.*' ." \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6a6b9dd..6189f39 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,9 +5,6 @@ on: tags: - v* -on: - pull_request: - env: PACKER_VERSION: "latest" DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} From 674a568ca6a01bfb59ac3594f58992b2e3eba028 Mon Sep 17 00:00:00 2001 From: alallema Date: Thu, 27 Apr 2023 18:59:16 +0200 Subject: [PATCH 2/3] Improve the manual trigger --- .../{aws_publish.yml => manual_publish.yml} | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) rename .github/workflows/{aws_publish.yml => manual_publish.yml} (59%) diff --git a/.github/workflows/aws_publish.yml b/.github/workflows/manual_publish.yml similarity index 59% rename from .github/workflows/aws_publish.yml rename to .github/workflows/manual_publish.yml index 08f61e0..02a22a6 100644 --- a/.github/workflows/aws_publish.yml +++ b/.github/workflows/manual_publish.yml @@ -1,7 +1,16 @@ -name: Publish AWS +name: Publish Manually on: workflow_dispatch: + inputs: + provider: + type: choice + description: Choose the provider you want to publish + options: + - "amazon-ebs.debian" + - "digitalocean.debian" + - "googlecompute.debian" + required: true env: PACKER_VERSION: "latest" @@ -23,8 +32,5 @@ jobs: - name: Run `packer init` run: "packer init ." - - name: Run `packer validate` - run: "packer validate ." - - name: Run `packer build` - run: "packer build -only 'amazon-ebs.*' ." \ No newline at end of file + run: "packer build -only ${{ github.event.inputs.provider }} ." \ No newline at end of file From 1bb436663fc7194deb30737258904d3b860085df Mon Sep 17 00:00:00 2001 From: Bruno Casali Date: Thu, 27 Apr 2023 19:04:54 +0200 Subject: [PATCH 3/3] Update manual_publish.yml --- .github/workflows/manual_publish.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual_publish.yml b/.github/workflows/manual_publish.yml index 02a22a6..bb0537e 100644 --- a/.github/workflows/manual_publish.yml +++ b/.github/workflows/manual_publish.yml @@ -7,9 +7,9 @@ on: type: choice description: Choose the provider you want to publish options: - - "amazon-ebs.debian" - - "digitalocean.debian" - - "googlecompute.debian" + - "amazon-ebs" + - "digitalocean" + - "googlecompute" required: true env: @@ -19,7 +19,7 @@ env: jobs: publishing: - name: publish-aws + name: publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -33,4 +33,4 @@ jobs: run: "packer init ." - name: Run `packer build` - run: "packer build -only ${{ github.event.inputs.provider }} ." \ No newline at end of file + run: "packer build -only ${{ github.event.inputs.provider }}.debian ."