Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

Commit 0418ad3

Browse files
authored
Upgrading (#9)
* bump * new example * Use python client * Use python client * Use python client * test env * Build gain * Build gain * test
1 parent 097812b commit 0418ad3

31 files changed

Lines changed: 3708 additions & 3760 deletions

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
node_modules
2-
**/node_modules
31
Dockerfile
42
action.yml
53
LICENSE
64
Makefile
75
readme.md
86
.gitignore
7+
.github

.github/workflows/build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,33 @@ jobs:
99

1010
steps:
1111
- name: checkout repo
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
- run: make image
14+
15+
test:
16+
runs-on: ubuntu-latest
17+
env:
18+
METABLOCK_API_TOKEN: ${{ secrets.METABLOCK_API_TOKEN }}
19+
METABLOCK_BLOCK_ID: 85ef26bff9f0454aa6ff0516b6d52420
20+
21+
steps:
22+
- name: checkout repo
23+
uses: actions/checkout@v4
24+
- name: build example
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: 22
28+
- name: build example
29+
run: make build-example
30+
- name: stage deployment
31+
uses: ./
32+
if: github.ref != 'refs/heads/main'
33+
with:
34+
env: stage
35+
bundle: example/dist
36+
- name: prod deployment
37+
uses: ./
38+
if: github.ref == 'refs/heads/main'
39+
with:
40+
env: prod
41+
bundle: example/dist

.github/workflows/test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
#
2-
# javascript
3-
node_modules
4-
bin
5-
dist
6-
package-lock.json
7-
8-
# directories
9-
coverage
10-
dist
11-
example/public
12-
.tmp
13-
141
#
152
# files
163
.DS_Store

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
FROM node:18-slim
1+
FROM python:3.13-slim
22

33
WORKDIR /action
44

5-
ENV DOCKER=yes NODE_ENV=production
6-
RUN npm i --global @metablock/cli@0.23.2
5+
RUN pip install metablock

Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@ image: ## Build image
1313

1414
.PHONY: terminal
1515
terminal: ## Terminal
16-
@docker run -it --rm metablock-action bash
16+
@docker run -it --rm \
17+
-v $(PWD):/action \
18+
metablock-action bash
1719

1820

1921
.PHONY: build-example
2022
build-example: ## Build example
21-
@cd example && yarn && yarn build
22-
23-
.PHONY: outdated-example
24-
outdated-example: ## Outdated example dependencies
25-
@cd example && yarn outdated
26-
27-
.PHONY: update-example
28-
update-example: ## Update example dependencies
29-
@cd example && yarn upgrade --latest
23+
@cd example && npm i && npm run build

action.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,25 @@ name: "Metablock Action"
22
description: "Make a new deployment into metablock cloud"
33
inputs:
44
token:
5-
description: "Metablock API token - can be set as METABLOCK_API_TOKEN env variable"
5+
description: "Metablock API token - can be set via the METABLOCK_API_TOKEN env variable"
66
block:
7-
description: "Metablock Block ID - can be set as METABLOCK_BLOCK_ID env variable"
7+
description: "Metablock Block ID - can be set via the METABLOCK_BLOCK_ID env variable"
88
bundle:
99
description: "Filesystem location of the bundle to deploy"
1010
default: "./dist"
1111
env:
12-
description: "Metablock environment to deploy"
12+
description: "Metablock environment - can be set via the METABLOCK_ENV env variable"
1313
default: "stage"
1414
runs:
1515
using: "docker"
1616
image: "Dockerfile"
1717
args:
1818
- metablock
1919
- ship
20+
- ${{ inputs.bundle }}
2021
- "--token"
2122
- ${{ inputs.token }}
22-
- "--block"
23+
- "--block-id"
2324
- ${{ inputs.block }}
24-
- "--bundle"
25-
- ${{ inputs.bundle }}
2625
- "--env"
2726
- ${{ inputs.env }}

example/.eslintrc.cjs

Lines changed: 0 additions & 14 deletions
This file was deleted.

example/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

example/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# React + TypeScript + Vite
2+
3+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4+
5+
Currently, two official plugins are available:
6+
7+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9+
10+
## Expanding the ESLint configuration
11+
12+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13+
14+
```js
15+
export default tseslint.config({
16+
extends: [
17+
// Remove ...tseslint.configs.recommended and replace with this
18+
...tseslint.configs.recommendedTypeChecked,
19+
// Alternatively, use this for stricter rules
20+
...tseslint.configs.strictTypeChecked,
21+
// Optionally, add this for stylistic rules
22+
...tseslint.configs.stylisticTypeChecked,
23+
],
24+
languageOptions: {
25+
// other options...
26+
parserOptions: {
27+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
28+
tsconfigRootDir: import.meta.dirname,
29+
},
30+
},
31+
})
32+
```
33+
34+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
35+
36+
```js
37+
// eslint.config.js
38+
import reactX from 'eslint-plugin-react-x'
39+
import reactDom from 'eslint-plugin-react-dom'
40+
41+
export default tseslint.config({
42+
plugins: {
43+
// Add the react-x and react-dom plugins
44+
'react-x': reactX,
45+
'react-dom': reactDom,
46+
},
47+
rules: {
48+
// other rules...
49+
// Enable its recommended typescript rules
50+
...reactX.configs['recommended-typescript'].rules,
51+
...reactDom.configs.recommended.rules,
52+
},
53+
})
54+
```

0 commit comments

Comments
 (0)