Skip to content

Commit

Permalink
[PLATFORM-2230]: Create an MVP for webkit support (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaeIsBad authored Oct 4, 2024
1 parent 2866362 commit f34d635
Show file tree
Hide file tree
Showing 16 changed files with 1,945 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use flake
export RUST_LOG=info
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
* @primait/shared-services
43 changes: 43 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CD

on:
release:
types: [published]
workflow_dispatch:
inputs:
tag_name:
description: "The tag name to use"
required: true
type: string

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b

- run: nix build .#dockerImage
- run: docker load -i ./result

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::193543784330:role/oidc-github-ecr-webkit-pdf-inator
aws-region: us-east-1

- name: Login to public ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
mask-password: "true"
registry-type: public

- name: Push image
run: |-
docker push webkit-pdf-inator \
"public.ecr.aws/primaassicurazioni/webkit-pdf-inator:${{ inputs.tag_name || github.event.release.tag_name }}"
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Test"
on:
pull_request:
push:
jobs:
get-flake-checks:
runs-on: ubuntu-latest
outputs:
flake-checks: "${{ steps.set-outputs.outputs.checks }}"
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b
- run: >
nix flake show --json
| jq -rc '.checks["x86_64-linux"]
| keys' >> "flake-checks"
- id: set-outputs
run: echo "checks=$(cat flake-checks)" >> "$GITHUB_OUTPUT"

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b
- run: nix build

flake-checks:
runs-on: ubuntu-latest
needs: [ get-flake-checks, build ]
strategy:
matrix:
check: ${{ fromJSON(needs.get-flake-checks.outputs.flake-checks) }}
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c
- uses: DeterminateSystems/magic-nix-cache-action@87b14cf437d03d37989d87f0fa5ce4f5dc1a330b
- run: nix build -L ".#checks.x86_64-linux.$check"
env:
check: "${{ matrix.check }}"
alls-green:
if: always()
needs:
- flake-checks
runs-on: ubuntu-latest
steps:
- run: ${{ !contains(needs.*.result, 'failure') }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/target
result*
.direnv/
*.pdf
Loading

0 comments on commit f34d635

Please sign in to comment.