diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b48f113 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: GEMINI CAOM-2 image build + +on: + release: + +jobs: + # + # Package jobs + # + package: + uses: ./.github/workflows/docker.yml + secrets: inherit + with: + name: gem2caom2 + # + # End Package Jobs + # diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..be5747e --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,51 @@ +name: Docker build and push workflow + +env: + # Allow the set-env command below + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + +on: + workflow_call: + inputs: + name: + required: true + type: string + secrets: + CI_REGISTRY_USER: + required: true + CI_REGISTRY_TOKEN: + required: true + CI_REGISTRY_ORGANIZATION: + required: true + +jobs: + docker-build-publish: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker BuildX + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.CI_REGISTRY_USER }} + password: ${{ secrets.CI_REGISTRY_TOKEN }} + - + name: Set Docker tag + run: | + _TS_TAG=$(date +'%Y%m%d%H%M') + echo "::set-env name=TS_TAG::$_TS_TAG" + - + name: Build and push + uses: docker/build-push-action@v3 + with: + context: . + push: true + tags: ${{ secrets.CI_REGISTRY_ORGANIZATION }}/${{ inputs.name }}:latest, ${{ secrets.CI_REGISTRY_ORGANIZATION }}/${{ inputs.name }}:${{ env.TS_TAG }}