From e8a6f0fbd59b43333f90e3240d9429e571aea7e6 Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Fri, 31 May 2024 10:52:21 +0200 Subject: [PATCH] CI action to create Docker releases --- .github/workflows/release_docker.yml | 51 ++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/release_docker.yml diff --git a/.github/workflows/release_docker.yml b/.github/workflows/release_docker.yml new file mode 100644 index 00000000..9695f2c0 --- /dev/null +++ b/.github/workflows/release_docker.yml @@ -0,0 +1,51 @@ +name: Release Docker +# Builds and deploys images to Dockerhub + +on: + workflow_dispatch: + inputs: + tag: + description: 'Docker tag (e.g. 1.1.0 or stable)' + required: true + default: 'x.y.z' + +env: + # GitHub runners currently have two cores + NR_JOBS: "2" + +jobs: + deploy: + name: Deploy (${{ matrix.buildtType.name }}) + runs-on: ubuntu-latest + strategy: + matrix: + buildType: + - {name: "Debug", + suffix: "-debug", + distro: "storm-basesystem:latest", + } + - {name: "Release", + suffix: "", + distro: "storm-basesystem:latest", + } + steps: + - name: Git clone + uses: actions/checkout@v4 + - name: Build Carl-storm from Dockerfile + run: | + docker build -t movesrwth/carl-storm:${{ github.event.inputs.tag }}${{ matrix.buildType.suffix }} . \ + --build-arg BASE_IMAGE=movesrwth/${{ matrix.buildType.distro }} \ + --build-arg build_type="${{ matrix.buildType.name }}" \ + --build-arg no_threads=${NR_JOBS} + - name: Login to Docker Hub + # Only login if using original repo + if: github.repository_owner == 'moves-rwth' + uses: docker/login-action@v3 + with: + username: ${{ secrets.STORM_CI_DOCKER_USERNAME }} + password: ${{ secrets.STORM_CI_DOCKER_TOKEN }} + - name: Deploy Carl-storm + # Only deploy if using original repo + if: github.repository_owner == 'moves-rwth' + run: | + docker push movesrwth/carl-storm:${{ github.event.inputs.tag }}${{ matrix.buildType.suffix }}