remove default error value #1847
This file contains hidden or 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: Run tests and build | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 10 | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Test | |
run: pnpm test | |
continue-on-error: true | |
- name: Build | |
run: pnpm build | |
docker: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Setup environment variables | |
run: | | |
echo "IMAGE_TAG=${GITHUB_REF##*/}" >> $GITHUB_ENV | |
echo "DOCKER_USERNAME=$DOCKER_USERNAME" >> $GITHUB_ENV | |
echo "DOCKER_PASSWORD=$DOCKER_PASSWORD" >> $GITHUB_ENV | |
if [[ $IS_MAIN == 'true' ]]; then | |
echo "DOCKER_IMAGE=aisheets/sheets" >> $GITHUB_ENV | |
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV | |
echo "IMAGE_TAG=dev" >> $GITHUB_ENV | |
elif [[ $IS_RELEASE == 'true' ]]; then | |
echo "DOCKER_IMAGE=aisheets/sheets" >> $GITHUB_ENV | |
echo "PLATFORMS=linux/amd64,linux/arm64" >> $GITHUB_ENV | |
else | |
echo "DOCKER_IMAGE=aisheets/sheets-dev" >> $GITHUB_ENV | |
echo "PLATFORMS=linux/amd64" >> $GITHUB_ENV | |
fi | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/stable' }} | |
IS_MAIN: ${{ github.ref == 'refs/heads/main' }} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ env.DOCKER_USERNAME }} | |
password: ${{ env.DOCKER_PASSWORD }} | |
- name: Build and push image | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
tags: ${{ env.DOCKER_IMAGE }}:${{ env.IMAGE_TAG }} | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true | |
- name: Push latest image | |
if: github.ref == 'refs/heads/stable' | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: ${{ env.PLATFORMS }} | |
tags: ${{ env.DOCKER_IMAGE }}:latest | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true |