bliss-js/.github/workflows/docker-image.yml

41 lines
1.3 KiB
YAML
Raw Normal View History

2024-05-24 21:04:32 +03:00
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
2024-05-24 21:14:50 +03:00
- name: Build Docker image (aarch64)
2024-05-24 21:04:32 +03:00
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm64
id: build-aarch64
- name: Extract file (aarch64)
2024-05-24 21:14:50 +03:00
run: ID=$(docker create ${{ steps.build-aarch64.outputs.imageid }}) echo $ID; docker cp $ID:/opt/app/target/release/libbliss_js.so index-aarch64-unknown-linux-gnu.node; docker rm $ID
2024-05-24 21:04:32 +03:00
2024-05-24 21:14:50 +03:00
- name: Build Docker image (x86_64)
2024-05-24 21:04:32 +03:00
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
id: build-x86_64
- name: Extract file (x86_64)
2024-05-24 21:14:50 +03:00
run: ID=$(docker create ${{ steps.build-x86_64.outputs.imageid }}) echo $ID; docker cp $ID:/opt/app/target/release/libbliss_js.so index-x86_64-unknown-linux-gnu.node; docker rm $ID
2024-05-24 21:04:32 +03:00
- 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