docs: enhance Railway deployment quick start guide #133
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: ozma-embedded | |
on: push | |
jobs: | |
build: | |
name: Build | |
permissions: | |
contents: read | |
id-token: write | |
attestations: write | |
outputs: | |
artifact-id: ${{ steps.upload.outputs.artifact-id }} | |
artifact-url: ${{ steps.upload.outputs.artifact-url }} | |
bundle-id: ${{ steps.upload-bundle.outputs.artifact-id }} | |
bundle-url: ${{ steps.upload-bundle.outputs.artifact-url }} | |
defaults: | |
run: | |
working-directory: ./ozma-embedded | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
cache: yarn | |
cache-dependency-path: ./ozma-embedded/yarn.lock | |
- name: Install Dependencies | |
run: | | |
yarn set version stable | |
yarn install --immutable | |
- name: Check Formatting | |
run: | | |
yarn prettier -c | |
- name: Lint | |
run: | | |
yarn lint --no-fix --max-warnings 0 | |
- name: Build | |
env: | |
NODE_ENV: production | |
run: | | |
yarn build | |
- name: Pack | |
env: | |
NODE_ENV: production | |
run: | | |
yarn pack | |
- name: Upload Artifacts | |
id: upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ozma-embedded | |
path: ./ozma-embedded/*.tgz | |
if-no-files-found: error | |
- name: Upload Bundle | |
id: upload-bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ozma-embedded-bundle | |
path: ./ozma-embedded/bundle/embedded.min.js | |
if-no-files-found: error | |
# - name: Attest | |
# uses: actions/attest-build-provenance@v1 | |
# with: | |
# subject-path: ozma-embedded/bundle/embedded.min.js | |
publish-release: | |
name: Publish Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: build | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
runs-on: ubuntu-22.04 | |
defaults: | |
run: | |
working-directory: ozma-embedded | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
always-auth: true | |
- name: Download Release | |
uses: actions/download-artifact@v4 | |
with: | |
name: ozma-embedded | |
path: ./ozma-embedded/ | |
- name: Check the version | |
env: | |
REF: ${{ github.ref }} | |
run: | | |
rel_version=${REF#refs/tags/v} | |
curr_version=$(jq -r .version package.json) | |
if [ "$rel_version" != "$curr_version" ]; then | |
echo "Tag doesn't correspond to the project version. Expected '$rel_version', got '$curr_version'." >&2 | |
exit 1 | |
fi | |
echo "Publishing version: $rel_version" | |
- name: Publish to NPM | |
env: | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: | | |
yarn publish --access public *.tgz |