Bump the npm_and_yarn group across 2 directories with 10 updates #121
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: frontend | |
on: | |
push: | |
paths: | |
- frontend/** | |
- .github/workflows/frontend.yml | |
branches: [ "**" ] | |
tags: | |
- 'spa-*.*.*' | |
pull_request: | |
paths: | |
- frontend/** | |
- .github/workflows/frontend.yml | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
baseDirectory: [ "frontend/spa" ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install PNPM | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
working-directory: ${{ matrix.baseDirectory }} | |
- name: Run tests | |
run: pnpm run validate | |
working-directory: ${{ matrix.baseDirectory }} | |
- name: Build project | |
run: pnpm run build | |
working-directory: ${{ matrix.baseDirectory }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build | |
path: ${{ matrix.baseDirectory }}/dist/ | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Determine Docker image tag | |
id: get-version | |
run: | | |
if git describe --tags --exact-match 2>/dev/null; then | |
TAG=$(git describe --tags --exact-match) | |
echo "VERSION=${TAG#spa-}" >> $GITHUB_ENV | |
else | |
echo "VERSION=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV | |
fi | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v6 | |
with: | |
context: ${{ matrix.baseDirectory }} | |
file: ${{ matrix.baseDirectory }}/docker/Dockerfile | |
push: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }} | |
tags: ghcr.io/${{ github.repository }}/frontend:${{ env.VERSION }} |