CI: Docker Build and Push with custom action #46
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: CI test | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Add system package | |
| run: sudo apt install -y libsqlite3-mod-spatialite | |
| - uses: actions/checkout@v3 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.0' | |
| bundler-cache: true | |
| - name: Run tests | |
| run: bundle exec rake test | |
| docker: | |
| runs-on: ubuntu-latest | |
| needs: [tests] | |
| if: github.ref == 'refs/heads/master' | |
| permissions: | |
| contents: read | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| steps: | |
| - name: Docker Build and Push | |
| uses: cartoway/docker-compose-build-push-action@main | |
| with: | |
| registry_password: ${{ secrets.GITHUB_TOKEN }} |