Skip to content

Fix/reworked ci (#100) #1

Fix/reworked ci (#100)

Fix/reworked ci (#100) #1

name: Toolshed Build and Publish
on:
push:
branches:
- 'master'
paths:
- 'toolshed/**'
- '.github/workflows/toolshed-on-push.yaml'
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get current branch
run: echo "VERSION=$(cat toolshed/backstage.json | jq -r '.version')" >> $GITHUB_ENV
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Setup yarn and build
run: |
yarn install --frozen-lockfile
yarn tsc
yarn build:backend --config ../../app-config.yaml
working-directory: toolshed
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and publish custom image
uses: docker/build-push-action@v6
with:
push: true
file: toolshed/packages/backend/Dockerfile
context: toolshed
tags: |
aidanhilt/toolshed:${{ env.VERSION }}
aidanhilt/toolshed:latest
platforms: linux/amd64, linux/arm64