mirror of
https://github.com/logos-storage/codex-factory.git
synced 2026-01-03 21:43:08 +00:00
* feat: build docker images with one script * feat: publish the built docker image * ci: init worflow to publish built docker image * chore: add the new commands to the package.json * ci: add npm setup command run * ci: build with only node 12.x * refactor: add github repo bee image prefix to .env * ci: github action input for build docker image * fix: intend in yaml * fix: typeo * fix: testing the rumor about github bug in order to show up the run workflow button * revert: prev commit - did not work * ci: only build image if it was clicked manually
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
buildImage:
|
|
description: 'Build Docker Image according to the environment'
|
|
default: 'false'
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
pull_request:
|
|
branches:
|
|
- '**'
|
|
|
|
env:
|
|
BEE_IMAGE_PREFIX: 'docker.pkg.github.com/ethersphere/bee-factory'
|
|
|
|
jobs:
|
|
bee-images:
|
|
name: Build and publish images
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 12
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 1
|
|
- name: Auth to Github Package Docker Registry
|
|
if: (github.ref == 'refs/heads/master' || ${{ github.event.inputs.buildImage }} == 'true') && success()
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
|
|
- name: Install npm deps
|
|
if: steps.cache-npm.outputs.cache-hit != 'true'
|
|
run: npm ci
|
|
- name: Build images
|
|
run: |
|
|
npm run build:env
|
|
- name: Publish if it was clicked manually
|
|
if: ${{ github.event.inputs.buildImage }} == 'true' && success()
|
|
run: |
|
|
npm run publish:env
|