Translated using Weblate (Japanese) #3
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: Build web container | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "web/**" | |
| - ".github/workflows/web.yml" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "web/**" | |
| - ".github/workflows/web.yml" | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./web | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Start dev server | |
| run: npm start & | |
| - name: Wait for server to start | |
| run: npx wait-on http://localhost:5173 | |
| - name: Run tests | |
| run: npm run test | |
| build: | |
| needs: test | |
| if: github.ref == 'refs/heads/main' | |
| env: | |
| IMAGE: ghcr.io/openinframap/web | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| id: docker_build | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./web | |
| file: ./web/Dockerfile.prod | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE }}:${{ github.sha }}-${{ github.run_number }} |