diff --git a/.github/actions/build-image/action.yml b/.github/actions/build-image/action.yml new file mode 100644 index 0000000..5fa4173 --- /dev/null +++ b/.github/actions/build-image/action.yml @@ -0,0 +1,21 @@ +name: 'Build And Publish Image' +description: 'Builds and publishes image' +inputs: + version: + description: 'image tag' + required: true + dockerhub-username: + description: 'dockerhub username' + required: true + dockerhub-password: + description: 'dockerhub password' + required: true +runs: + using: "composite" + steps: + - name: Build and Push image + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: springcloud/baseimage:${{ inputs.version }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2eb10c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + workflow_dispatch: + push: + paths-ignore: + - '.github/**' + +jobs: + build: + if: github.repository_owner == 'spring-cloud' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Determine version + run: | + echo baseimage_version=$(cat version.txt) >> $GITHUB_ENV + - name: Build and Publish Images + uses: ./.github/actions/build-images + with: + version: ${{ env.baseimage_version }} + dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }} + dockerhub-password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..7f20734 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.0.1 \ No newline at end of file