reorg js #180
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, Test, and Deploy | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test-and-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Run JavaScript unit tests | |
| run: npm test | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build Docker Image | |
| run: | | |
| docker build -t drmdev/board-games-api:latest . | |
| docker push drmdev/board-games-api:latest | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.2' | |
| bundler-cache: true | |
| - name: Install Jekyll dependencies and build site | |
| run: | | |
| bundle install | |
| bundle exec jekyll build | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| integration-tests: | |
| needs: test-and-build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v3 | |
| - name: Set up .NET 8 | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '8.0' | |
| - name: Set test environment variables | |
| run: | | |
| echo "TEST_HEADLESS=true" >> $GITHUB_ENV | |
| echo "TEST_BROWSER=chrome" >> $GITHUB_ENV | |
| - name: Restore Selenium test dependencies | |
| working-directory: SeleniumTests | |
| run: dotnet restore SeleniumTests.csproj | |
| - name: Build Selenium Tests | |
| working-directory: SeleniumTests | |
| run: dotnet build SeleniumTests.csproj --configuration Debug | |
| - name: Run Selenium Tests | |
| working-directory: SeleniumTests | |
| run: dotnet test SeleniumTests.csproj --verbosity normal --settings .runsettings |