diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcf3b18..0d45dc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,24 @@ on: branches: [ main ] jobs: + + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and run Dev Container task + uses: devcontainers/ci@v0.3 + with: + # Change this to point to your image name + imageName: ghcr.io/gresearch/astral-devcontainer + # Change this to be your CI task/script + runCmd: | + # Add multiple commands to run if needed + bundle install + scan_ruby: runs-on: ubuntu-latest @@ -16,6 +34,7 @@ jobs: - name: Run brakeman uses: devcontainers/ci@v0.3 with: + imageName: ghcr.io/gresearch/astral-devcontainer runCmd: bin/brakeman --no-pager lint: @@ -49,6 +68,7 @@ jobs: - name: Run tests uses: devcontainers/ci@v0.3 with: + imageName: ghcr.io/gresearch/astral-devcontainer runCmd: bin/rails test - name: Keep screenshots from failed system tests diff --git a/README.md b/README.md index a28d48c..85318bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # README -Astral-rails is a proof-of-concept api application intended to simplify +Astral is an api-only application intended to simplify certificate acquisition for other applications/services. Broadly speaking, it will: @@ -10,16 +10,20 @@ it will: # Running -This app is most easily run and developed in its devcontainer. +This Rails app is most easily run and developed in its devcontainer. 1) Open in devcontainer 2) Launch server using vscode launch config, or in terminal run: ``` rails s ``` -3) POST /certificates to acquire cert in terminal: +3) POST /certificates to acquire cert in another terminal (need to provide `common_name` param): ``` curl -X POST http://localhost:3000/certificates \ --H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhcHBsaWNhdGlvbl9uYW1lIiwiY29tbW9uX25hbWUiOiJleGFtcGxlLmNvbSIsImlwX3NhbnMiOiIxMC4wLjEuMTAwIn0.61e0oQIj7vwGtOpFuPJDCI_Bqf8ZTpJxe_2kUwcbN7Y" +-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhcHBsaWNhdGlvbl9uYW1lIiwiY29tbW9uX25hbWUiOiJleGFtcGxlLmNvbSIsImlwX3NhbnMiOiIxMC4wLjEuMTAwIn0.61e0oQIj7vwGtOpFuPJDCI_Bqf8ZTpJxe_2kUwcbN7Y" \ +-H "Content-type: application/json" -d '{ "common_name": "example.com" }' +``` +4) Run the tests from devcontainer terminal: +``` +rails test ``` -