From 9b9e70c4531313ad057820e45689f056c50abec1 Mon Sep 17 00:00:00 2001 From: Andrea Sgattoni Date: Thu, 16 Dec 2021 10:42:16 +0100 Subject: [PATCH] fix: releases-centos7.yml --- .github/workflows/releases-centos7.yml | 89 ++++++++++++++------------ docker/build-docker-file-src.sh | 3 - docker/centos7-src | 6 -- 3 files changed, 47 insertions(+), 51 deletions(-) delete mode 100644 docker/build-docker-file-src.sh delete mode 100644 docker/centos7-src diff --git a/.github/workflows/releases-centos7.yml b/.github/workflows/releases-centos7.yml index ed324a4aa..ae60893c2 100644 --- a/.github/workflows/releases-centos7.yml +++ b/.github/workflows/releases-centos7.yml @@ -10,50 +10,55 @@ env: jobs: docker_publish: - + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@master - - - name: Read antares-solver version - id: antares-version - uses: notiz-dev/github-action-json-property@release - with: - path: 'antares-version.json' - prop_path: 'antares_version' - - - name: Read antares-deps version - id: antares-deps-version - uses: notiz-dev/github-action-json-property@release - with: - path: 'antares-version.json' - prop_path: 'antares_deps_version' - - - name: Get branch name - id: branch-name - uses: tj-actions/branch-names@v5 - - - name: Create docker file with src - shell: bash - run: | - cd docker - sh build-docker-file-src.sh - - - name: Docker file push - uses: elgohr/Publish-Docker-Github-Action@master - env: - ANTARES_DEPS_VERSION: ${{steps.antares-deps-version.outputs.prop}} - ANTARES_SOLVER_VERSION: ${{steps.antares-version.outputs.prop}} - ANTARES_XPANSION_TAG: ${{ steps.branch-name.outputs.current_branch }} - with: - name: antaresrte/rte-antares - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - workdir: docker - dockerfile: build-centos7-src - cache: true - tags: centos7-xpansion-${{ steps.branch-name.outputs.current_branch }} - buildargs: ANTARES_DEPS_VERSION, ANTARES_SOLVER_VERSION, ANTARES_XPANSION_TAG + + - uses: actions/checkout@master + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v1.1.2 + with: + files: | + docker/centos7 + antares-version.json + + - name: Read antares-solver version + id: antares-version + if: steps.changed-files.outputs.modified_files != '' + uses: notiz-dev/github-action-json-property@release + with: + path: 'antares-version.json' + prop_path: 'antares_version' + + - name: Read antares-deps version + id: antares-deps-version + if: steps.changed-files.outputs.modified_files != '' + uses: notiz-dev/github-action-json-property@release + with: + path: 'antares-version.json' + prop_path: 'antares_deps_version' + + - name: Docker file push + id: docker_push + if: steps.changed-files.outputs.modified_files != '' + uses: elgohr/Publish-Docker-Github-Action@master + env: + ANTARES_DEPS_VERSION: ${{steps.antares-deps-version.outputs.prop}} + ANTARES_SOLVER_VERSION: ${{steps.antares-version.outputs.prop}} + with: + name: antaresrte/rte-antares + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + workdir: docker + dockerfile: centos7 + cache: true + tags: centos7-xpansion + buildargs: ANTARES_DEPS_VERSION, ANTARES_SOLVER_VERSION build: diff --git a/docker/build-docker-file-src.sh b/docker/build-docker-file-src.sh deleted file mode 100644 index 480364043..000000000 --- a/docker/build-docker-file-src.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -cat centos7 centos7-src > build-centos7-src \ No newline at end of file diff --git a/docker/centos7-src b/docker/centos7-src deleted file mode 100644 index 31c8561e8..000000000 --- a/docker/centos7-src +++ /dev/null @@ -1,6 +0,0 @@ -ARG ANTARES_XPANSION_TAG - -RUN git clone https://github.com/AntaresSimulatorTeam/antares-xpansion -b ${ANTARES_XPANSION_TAG} --single-branch -RUN cd antares-xpansion &&\ - git submodule update --init antares-deps -