Skip to content

Commit

Permalink
ci(release): update esi-shell version before deploying it (#98)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
plexoos authored Jul 10, 2024
1 parent ac3629b commit 721aff4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions esi-shell
Original file line number Diff line number Diff line change
Expand Up @@ -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=

Expand Down

0 comments on commit 721aff4

Please sign in to comment.