Improve server tests #60
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: To Develop | |
on: | |
push: | |
branches: | |
- develop-** | |
pull_request: | |
branches: | |
- develop-** | |
jobs: | |
verify-client: | |
uses: ./.github/workflows/verify-client-reusable.yml | |
verify-server: | |
uses: ./.github/workflows/verify-server-reusable.yml | |
verify: | |
needs: | |
- verify-client | |
- verify-server | |
uses: ./.github/workflows/verify-reusable.yml | |
docker-server: | |
needs: | |
- verify-client | |
- verify-server | |
- verify | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}-server | |
tags: | | |
type=raw,value=develop-${{ steps.package-version.outputs.current-version }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Get HEAD SHA | |
id: sha | |
shell: bash | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile.server | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: ${{ github.event_name == 'push' }} | |
build-args: | | |
VERSION_OVERRIDE_ARG=${{ steps.package-version.outputs.current-version }}-develop.${{ steps.sha.outputs.sha_short }} | |
docker-client: | |
needs: | |
- verify-client | |
- verify-server | |
- verify | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Build SPA | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install | |
working-directory: ./client | |
shell: bash | |
- name: Get version | |
id: package-version | |
uses: martinbeentjes/npm-get-version-action@v1.3.1 | |
- name: Get HEAD SHA | |
id: sha | |
shell: bash | |
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Run build script | |
run: yarn build | |
working-directory: ./client | |
shell: bash | |
env: | |
VITE_VERSION_OVERRIDE: ${{ steps.package-version.outputs.current-version }}-develop.${{ steps.sha.outputs.sha_short }} | |
# Build docker image | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ghcr.io/${{ github.repository }}-client | |
tags: | | |
type=raw,value=develop-${{ steps.package-version.outputs.current-version }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./Dockerfile.client | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: ${{ github.event_name == 'push' }} |