Skip to content

Commit

Permalink
ci: implement build workflow (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarmuega authored Jan 14, 2024
1 parent 607f265 commit ee40d08
Show file tree
Hide file tree
Showing 8 changed files with 5,936 additions and 64 deletions.
8 changes: 8 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:20

COPY build-artifacts /code

WORKDIR /code/web
RUN yarn install

ENTRYPOINT [ "yarn", "run", "start" ]
61 changes: 57 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,67 @@ jobs:
with:
node-version: "20"

- name: napi-rs build
- name: napi-pallas
working-directory: napi-pallas
run: yarn run build
run: yarn install && yarn run build

- name: web
working-directory: web
run: yarn install && yarn run build

- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: build-artifacts
path: |
**/build
**/dist
web/build
web/public
web/package.json
napi-pallas/index.js
napi-pallas/package.js
napi-pallas/yarn.lock
napi-pallas/*.node
napi-pallas/npm
docker:
runs-on: ubuntu-latest
needs: [build]

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/txpipe/laceanatomy
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha
- name: Login to DockerHub
uses: docker/login-action@v2
with:
registry: ghcr.io/txpipe
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Download artifacts
uses: actions/download-artifact@v3

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: .github/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Binary file modified .yarn/install-state.gz
Binary file not shown.
18 changes: 0 additions & 18 deletions Dockerfile

This file was deleted.

32 changes: 2 additions & 30 deletions yarn.lock → napi-pallas/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1006,14 +1006,6 @@ __metadata:
languageName: node
linkType: hard

"laceanatomy@workspace:.":
version: 0.0.0-use.local
resolution: "laceanatomy@workspace:."
dependencies:
typescript: "npm:^5.1.6"
languageName: unknown
linkType: soft

"load-json-file@npm:^7.0.0":
version: 7.0.1
resolution: "load-json-file@npm:7.0.1"
Expand Down Expand Up @@ -1249,9 +1241,9 @@ __metadata:
languageName: node
linkType: hard

"napi-pallas@workspace:napi-pallas":
"napi-pallas@workspace:.":
version: 0.0.0-use.local
resolution: "napi-pallas@workspace:napi-pallas"
resolution: "napi-pallas@workspace:."
dependencies:
"@napi-rs/cli": "npm:^2.17.0"
ava: "npm:^5.1.1"
Expand Down Expand Up @@ -1737,26 +1729,6 @@ __metadata:
languageName: node
linkType: hard

"typescript@npm:^5.1.6":
version: 5.3.3
resolution: "typescript@npm:5.3.3"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: e33cef99d82573624fc0f854a2980322714986bc35b9cb4d1ce736ed182aeab78e2cb32b385efa493b2a976ef52c53e20d6c6918312353a91850e2b76f1ea44f
languageName: node
linkType: hard

"typescript@patch:typescript@npm%3A^5.1.6#optional!builtin<compat/typescript>":
version: 5.3.3
resolution: "typescript@patch:typescript@npm%3A5.3.3#optional!builtin<compat/typescript>::version=5.3.3&hash=e012d7"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: 1d0a5f4ce496c42caa9a30e659c467c5686eae15d54b027ee7866744952547f1be1262f2d40de911618c242b510029d51d43ff605dba8fb740ec85ca2d3f9500
languageName: node
linkType: hard

"unique-filename@npm:^3.0.0":
version: 3.0.0
resolution: "unique-filename@npm:3.0.0"
Expand Down
11 changes: 0 additions & 11 deletions package.json

This file was deleted.

2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"isbot": "^4.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"napi-pallas": "*"
"napi-pallas": "../napi-pallas"
},
"devDependencies": {
"@remix-run/dev": "^2.5.0",
Expand Down
Loading

0 comments on commit ee40d08

Please sign in to comment.