Skip to content

Build and push

Build and push #552

name: Build and push
on:
push:
branches:
- master
workflow_dispatch:
inputs:
rebuild:
description: 'Set to "true" to force re-build last 5 tags'
required: true
options:
- 'true'
- 'false'
default: 'false'
schedule:
- cron: '20 1 * * *'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- run: sudo apt update && sudo apt install -y qemu-user-static
- 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
- name: Login docker hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin
- name: Build and push
run: cd scripts && node ci_cd.js rebuild=${{ inputs.rebuild }}