From 58287f29d45668072431025c95648a85912ac53a Mon Sep 17 00:00:00 2001 From: Bryan Vestey Date: Sat, 25 May 2024 14:11:38 -0700 Subject: [PATCH] Combine actions --- .github/workflows/bundev.yaml | 50 ------------------ .../{godev.yaml => dev-container.yaml} | 15 ++++-- .github/workflows/nodedev.yaml | 51 ------------------- 3 files changed, 11 insertions(+), 105 deletions(-) delete mode 100644 .github/workflows/bundev.yaml rename .github/workflows/{godev.yaml => dev-container.yaml} (79%) delete mode 100644 .github/workflows/nodedev.yaml diff --git a/.github/workflows/bundev.yaml b/.github/workflows/bundev.yaml deleted file mode 100644 index 664013a..0000000 --- a/.github/workflows/bundev.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: bundev-container-building -on: - workflow_dispatch: - inputs: - version: - description: 'The version of bun to build on top of' - required: true - type: string - os: - description: 'The operating system base to use, like alpine, and should start with a -' - required: false - type: string - default: '' - -env: - VERSION: ${{ github.event.inputs.version }} - OS: ${{ github.event.inputs.os }} - -jobs: - build-containers-ghcr: - runs-on: ubuntu-latest - steps: - - name: 'Checkout the code' - uses: actions/checkout@v2 - - - name: 'Log into GHCR' - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Extract metadata (tags, labels) for the container.' - id: meta - uses: docker/metadata-action@v3 - with: - images: ghcr.io/bzvestey/bundev - tags: | - ${{ env.VERSION }}${{ env.OS }} - latest - - - name: 'Build and Push the container.' - uses: docker/build-push-action@v2 - with: - context: ./nodedev - push: true - tags: ${{ steps.meta.outputs.tags }} - build-args: | - version=${{ env.VERSION }} - os=${{ env.OS }} diff --git a/.github/workflows/godev.yaml b/.github/workflows/dev-container.yaml similarity index 79% rename from .github/workflows/godev.yaml rename to .github/workflows/dev-container.yaml index c87550c..62dd127 100644 --- a/.github/workflows/godev.yaml +++ b/.github/workflows/dev-container.yaml @@ -1,7 +1,15 @@ -name: godev-container-building +name: container-building on: workflow_dispatch: inputs: + container: + description: 'The container to buld' + required: true + type: choice + options: + - bundev + - godev + - nodedev version: description: 'The version of Go to build on top of' required: true @@ -34,7 +42,7 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: ghcr.io/bzvestey/godev + images: ghcr.io/bzvestey/${{ inputs.container }} tags: | ${{ env.VERSION }}${{ env.OS }} latest @@ -42,10 +50,9 @@ jobs: - name: 'Build and Push the container.' uses: docker/build-push-action@v2 with: - context: ./godev + context: ./${{ inputs.container }} push: true tags: ${{ steps.meta.outputs.tags }} build-args: | version=${{ env.VERSION }} os=${{ env.OS }} - diff --git a/.github/workflows/nodedev.yaml b/.github/workflows/nodedev.yaml deleted file mode 100644 index ed1a0c1..0000000 --- a/.github/workflows/nodedev.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: nodedev-container-building -on: - workflow_dispatch: - inputs: - version: - description: 'The version of node to build on top of' - required: true - type: string - os: - description: 'The operating system base to use, like alpine, and should start with a -' - required: false - type: string - default: '' - -env: - VERSION: ${{ github.event.inputs.version }} - OS: ${{ github.event.inputs.os }} - -jobs: - build-containers-ghcr: - runs-on: ubuntu-latest - steps: - - name: 'Checkout the code' - uses: actions/checkout@v2 - - - name: 'Log into GHCR' - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: 'Extract metadata (tags, labels) for the container.' - id: meta - uses: docker/metadata-action@v3 - with: - images: ghcr.io/bzvestey/nodedev - tags: | - ${{ env.VERSION }}${{ env.OS }} - latest - - - name: 'Build and Push the container.' - uses: docker/build-push-action@v2 - with: - context: ./nodedev - push: true - tags: ${{ steps.meta.outputs.tags }} - build-args: | - version=${{ env.VERSION }} - os=${{ env.OS }} -