diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index d317818..10d3e8f 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -8,8 +8,6 @@ on: env: DOCKER_REPO: ${{ vars.DOCKER_USERNAME }}/clonezilla - URL: https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso - UPLOAD_LATEST: true jobs: build_and_deploy: @@ -17,10 +15,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Read config from build.env + run: | + cat build.env >> $GITHUB_ENV + - name: Build Docker Container run: | TMPDIR=$(mktemp -d) - sudo ./src/main/scripts/build.sh --dir=${TMPDIR} --url=${URL} --docker-repo=${DOCKER_REPO} + sudo ./src/main/scripts/build.sh --dir=${TMPDIR} --url=${{ env.URL }} --docker-repo=${DOCKER_REPO} - name: Log in to Docker Hub uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a @@ -32,6 +34,6 @@ jobs: shell: bash run: | docker images - [ "${UPLOAD_LATEST}" = false ] && docker rmi ${DOCKER_REPO}:latest + [ "${{ env.UPLOAD_LATEST }}" = false ] && docker rmi ${DOCKER_REPO}:latest docker push ${DOCKER_REPO} --all-tags - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' \ No newline at end of file diff --git a/.github/workflows/manual-update.yml b/.github/workflows/manual-update.yml index d45fb37..6ef9671 100644 --- a/.github/workflows/manual-update.yml +++ b/.github/workflows/manual-update.yml @@ -20,9 +20,9 @@ jobs: VERSION=$(basename "${{ github.event.inputs.url }}" | sed -e 's/clonezilla-live-//' -e 's/-amd64.iso//') echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT - - name: Update ci-cd.yml + - name: Update configuration file run: | - sed -i 's| URL:.*| URL: ${{ github.event.inputs.url }}|' .github/workflows/ci-cd.yml + sed -i 's|^URL=.*|URL=${{ github.event.inputs.url }}|' build.env - name: Create Pull Request uses: peter-evans/create-pull-request@v6 @@ -30,6 +30,9 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "Update Clonezilla to ${{ steps.parse_version.outputs.VERSION }}" title: "Update to Clonezilla ${{ steps.parse_version.outputs.VERSION }}" - body: "This PR updates the Clonezilla version to `${{ steps.parse_version.outputs.VERSION }}`." + body: | + This PR updates the Clonezilla version to `${{ steps.parse_version.outputs.VERSION }}`. + + The `build.env` configuration file has been updated. branch: "feat/clonezilla-${{ steps.parse_version.outputs.VERSION }}" base: main \ No newline at end of file diff --git a/build.env b/build.env new file mode 100644 index 0000000..b355da6 --- /dev/null +++ b/build.env @@ -0,0 +1,2 @@ +URL=https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/3.2.1-28/clonezilla-live-3.2.1-28-amd64.iso +UPLOAD_LATEST=true \ No newline at end of file