build #1006
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
workflow_dispatch: | |
inputs: | |
cypress: | |
description: 'Run cypress' | |
required: false | |
type: boolean | |
default: false | |
build_docker_image: | |
description: 'Build docker image' | |
required: false | |
type: boolean | |
default: false | |
push: | |
schedule: | |
- cron: '15 1 * * *' | |
permissions: write-all | |
jobs: | |
build: | |
uses: datavisyn/github-workflows/.github/workflows/build-node-python.yml@new_deployment | |
secrets: inherit | |
with: | |
cypress_enable: true | |
cypress_run_because_flag: ${{ inputs.cypress == true }} | |
cypress_runs_on: "Ubuntu-22.04" | |
build-docker: | |
# needs: [build] | |
if: inputs.build_docker_image == true | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up node version | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.16' | |
- name: Show node and npm version | |
run: | | |
corepack enable | |
node -v | |
npm -v | |
shell: bash | |
- name: Git config | |
run: | | |
git config --global url."https://github.com/".insteadOf ssh://[email protected]/ | |
git config --add --global url."https://github.com/".insteadOf [email protected]: | |
- name: Install dependencies | |
run: yarn install --no-immutable --inline-builds | |
shell: bash | |
- name: Webpack build | |
run: yarn run webpack:prod | |
shell: bash | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/jku-vds-lab/reaction-cime | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |