41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
name: Publish Docker image
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
push_to_registry:
|
|
name: Push Docker image to the registry
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Check out the repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Build and push Docker image (aarch64)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/arm64
|
|
id: build-aarch64
|
|
|
|
- name: Extract file (aarch64)
|
|
run: ID=$(docker create ${{ steps.build-aarch64.outputs.imageid }}) docker cp $ID:/opt/app/target/release/libbliss_js.so index-aarch64-unknown-linux-gnu.node; docker rm $ID
|
|
|
|
- name: Build and push Docker image (x86_64)
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
platforms: linux/amd64
|
|
id: build-x86_64
|
|
|
|
- name: Extract file (x86_64)
|
|
run: ID=$(docker create ${{ steps.build-x86_64.outputs.imageid }}) docker cp $ID:/opt/app/target/release/libbliss_js.so index-x86_64-unknown-linux-gnu.node; docker rm $ID
|
|
|
|
- name: Log in to NPM
|
|
run: |
|
|
npm config set @bliss-rs:registry https://gitea.antonlyap.pp.ua/api/packages/antonlyap/npm/ && \
|
|
echo //gitea.antonlyap.pp.ua/api/packages/antonlyap/npm/:_authToken=${{ secrets.NPM_TOKEN }} > ~/.npmrc
|
|
|
|
- run: npm publish
|