Skip to content

Fix spellsource-web PROJECT_VERSION usage #8

Fix spellsource-web PROJECT_VERSION usage

Fix spellsource-web PROJECT_VERSION usage #8

Workflow file for this run

name: Build Image (Develop)
on:
push:
branches: ['develop']
jobs:
build-and-deploy-server:
# if: "startsWith(github.ref, 'refs/tags/')" # Deploy a new server version when a new tag is pushed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
- run: git lfs checkout
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: oracle
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.x.x
- uses: gradle/actions/wrapper-validation@v3
- name: Test with Gradle
run: ./gradlew --no-parallel test
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Server Image
run: ./gradlew spellsource-server:githubDockerPush
build-and-deploy-website:
if: "!startsWith(github.ref, 'refs/tags/')" # Deploy a new website version for each push to master
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true # TODO still needed just for website?
- run: git lfs checkout
- uses: actions/setup-java@v4
with:
java-version: '23'
distribution: oracle
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: gradle/actions/wrapper-validation@v3
- name: Test with Gradle
run: ./gradlew --no-parallel :spellsource-web:yarnRunTest
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set Project Version
run: |
COMMIT_SHA=$(git rev-parse --short=7 HEAD)
TIMESTAMP=$(date +%s)
echo "PROJECT_VERSION=${COMMIT_SHA}-${TIMESTAMP}" >> $GITHUB_ENV
- name: Build Website Image
run: ./gradlew spellsource-web:githubDockerPush
env:
PROJECT_VERSION: ${{ env.PROJECT_VERSION }}