39 lines
960 B
YAML
39 lines
960 B
YAML
name: Build and push
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
inputs:
|
|
rebuild:
|
|
description: 'Set to "true" to force re-build last 5 tags'
|
|
required: true
|
|
options:
|
|
- 'true'
|
|
- 'false'
|
|
default: 'false'
|
|
schedule:
|
|
- cron: '0 0 * * *'
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '18.16.0'
|
|
|
|
- name: Setup docker
|
|
uses: actions-hub/docker/cli@master
|
|
env:
|
|
SKIP_LOGIN: true
|
|
|
|
# https://github.com/actions-hub/docker/blob/master/login/entrypoint.sh
|
|
- run: |
|
|
echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
|
|
cd scripts && node ci_cd.js rebuild=${{ inputs.rebuild }} |