Add component guidelines for PlaceCal #3572
Workflow file for this run
This file contains 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: Test and maybe deploy | |
on: | |
- push | |
jobs: | |
test-and-deploy: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:13.4 # Same version as on the server | |
env: | |
POSTGRES_PORT: 5432 | |
POSTGRES_DB: placecal_test | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: foobar | |
ports: | |
- 5432:5432 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
env: | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 5432 | |
POSTGRES_USER: postgres | |
PGPASSWORD: foobar | |
steps: | |
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3 | |
with: | |
fetch-depth: 0 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
cache-version: 3 | |
- uses: nodenv/actions/setup-nodenv@v2 | |
- uses: nodenv/actions/node-version@v2 | |
id: nodenv | |
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3 | |
with: | |
node-version: ${{ steps.nodenv.outputs.node-version }} | |
cache: yarn | |
- run: yarn install --immutable | |
- run: bin/test --unit --no-lint | |
- run: bin/test --system --no-lint | |
- run: bin/test --lint --no-fix | |
- if: failure() | |
name: Upload test screenshots | |
uses: actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5 # v3 | |
with: | |
name: test-screenshots | |
path: tmp/screenshots/ | |
if-no-files-found: ignore | |
- if: github.ref == 'refs/heads/main' | |
name: Deploy to placecal-staging.org | |
uses: dokku/github-action@036bf9c07f1b40707a16201bc7a349074c3ec554 # v1.6.1 | |
with: | |
branch: main | |
ci_branch_name: main | |
git_remote_url: "ssh://[email protected]:666/placecal" | |
ssh_private_key: ${{ secrets.CI_STAGING_KEY }} | |
- if: github.ref == 'refs/heads/production' | |
name: Deploy to placecal.org | |
uses: dokku/github-action@036bf9c07f1b40707a16201bc7a349074c3ec554 # v1.6.1 | |
with: | |
branch: main | |
ci_branch_name: production | |
git_remote_url: "ssh://[email protected]:666/placecal" | |
ssh_private_key: ${{ secrets.CI_PRODUCTION_KEY }} |