Skip to content

iniital commit

iniital commit #8

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
REGISTRY: ghcr.io
BINGO_FRONTEND_IMAGE_NAME: ${{ github.repository }}-bingo-fe
BINGO_BE_IMAGE_NAME: ${{ github.repository }}-bingo-be
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-node@v3
with:
node-version: 20
- name: Get Rush version
id: rush-version
# run: echo "RUSH_VERSION=$(node -p "require('./rush.json').rushVersion")" >> $GITHUB_OUTPUT
run: echo "RUSH_VERSION=5.134.0" >> $GITHUB_OUTPUT
- name: Cache Rush
uses: actions/cache@v4
with:
path: |
common/temp/install-run
~/.rush
key: ${{ runner.os }}-rush-${{ steps.rush-version.outputs.RUSH_VERSION }}
- name: tree
run: tree ./
- name: Cache node modules
uses: actions/cache@v4
with:
path: |
common/temp/node_modules
**/node_modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-modules-
- name: Verify Change Logs
run: node common/scripts/install-run-rush.js change --verify
- name: Rush Install
run: node common/scripts/install-run-rush.js install
- name: Rush rebuild
run: node common/scripts/install-run-rush.js rebuild --verbose
# - name: Run tests
# run: node common/scripts/install-run-rush.js test --verbose
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: |
packages/*/dist
packages/*/lib
packages/*/build
docker-build:
permissions:
contents: read
packages: write
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
image: [bingo-fe, bingo-be]
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: dist
path: packages
- name: Extract version or set default
id: get_version
shell: bash
run: |
VERSION=$(git describe --tags --abbrev=0 --always)
if [[ $VERSION =~ ^v[0-9]+\.[0-9]+\.[0-9]+-(alpha|beta) ]]; then
echo "version=$VERSION" >> $GITHUB_OUTPUT
else
echo "version=latest" >> $GITHUB_OUTPUT
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.image }}-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.image }}-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: ./packages/${{ matrix.image }}
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ env.REGISTRY }}/${{ github.repository_owner }}/bingo-simulator-${{ matrix.image }}:${{ steps.get_version.outputs.version }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache