From 721aff4d5e6d6bacfb7a0173b3df1a51aeb253b1 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 9 Jul 2024 21:44:50 -0400 Subject: [PATCH] ci(release): update esi-shell version before deploying it (#98) With this change we update esi-shell self version before deploying the script with GitHub Pages. Also, switching to "GitHub Actions" source in the repo settings > Pages --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ esi-shell | 1 + 2 files changed, 36 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 684cc6a..b6ccc60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,6 +76,41 @@ jobs: cache-from: ${{ env.IMAGE_NAME }}:latest cache-to: type=inline + deploy: + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build-test-release + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + + - name: Update esi-shell version + run: | + SEMVER=$(grep -Po '"version": "\K[^"]*' package.json) + sed -i "s/ESI_SHELL_VERSION=.*/ESI_SHELL_VERSION=${SEMVER}-$(git rev-parse --short HEAD)/g" esi-shell + + - name: Setup Pages + uses: actions/configure-pages@v5 + + - name: Build with Jekyll + uses: actions/jekyll-build-pages@v1 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + cleanup: runs-on: ubuntu-latest needs: build-test-release diff --git a/esi-shell b/esi-shell index 95def11..2afc531 100755 --- a/esi-shell +++ b/esi-shell @@ -29,6 +29,7 @@ REQUIRED_DOCKER_VERSION=23.0.0 IMAGE_NAME="ghcr.io/bnlnpps/esi-shell" DEFAULT_VERSION="latest" VERSION=$DEFAULT_VERSION +ESI_SHELL_VERSION= CONTAINER_COMMAND= CONTAINER_OPTIONS=