Skip to content

Fix Dockerfile

Fix Dockerfile #183

Workflow file for this run

on: push
name: CI
jobs:
build:
name: Build
strategy:
fail-fast: false
matrix:
node-version: [ 18.x ]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use current yarn
run: yarn set version stable
- name: yarn install
run: yarn install
- name: Package release archive
run: yarn run package
- name: Save release archive
uses: actions/upload-artifact@v2
with:
name: release-archive-${{ matrix.os }}
path: build/*.zip
build-and-push-image:
name: Build and push image
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: ${{ startsWith(github.ref, 'refs/tags/') }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish-release:
name: Publish release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Set up Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npm publish --access public
- name: Fetch release archives
uses: actions/download-artifact@v3
- name: Get the tag name
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}
- name: Create github release
uses: felixbrucker/github-actions/publish-release@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: --name Chia-Dashboard-Satellite
- uses: AButler/upload-release-assets@v2.0
with:
files: 'release-archive-*/*.zip'
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ steps.tag.outputs.TAG }}