CD innovazione.gov.it #3707
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
# This is a basic workflow to help you get started with Actions | |
name: CD innovazione.gov.it | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
workflow_dispatch: | |
inputs: | |
details: | |
description: 'External dispatch' | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: yarn install --frozen-lockfile | |
- name: Setup ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
bundler-cache: true | |
- name: Install ruby dependencies | |
run: bundle install --deployment | |
- name: Application build | |
run: | | |
yarn build | |
yarn middleman:build | |
env: | |
BUILD_ENV: production | |
BASE_URL: https://innovazione.gov.it | |
DATO_API_TOKEN: ${{ secrets.DATO_API_TOKEN }} | |
TZ: Europe/Rome | |
- name: Copy file | |
run: | | |
rm "./build/images/logo-mid-white-6d6c98f9.svg" | |
cp "./source/images/logo-mitd-white.svg" "./build/images/logo-mid-white-6d6c98f9.svg" | |
- name: gh_pages_deploy | |
run: | | |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
yarn deploy -- --dotfiles -m "Automated deployment: ${GITHUB_SHA} [ci skip]" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: The job has failed | |
if: cancelled() || failure() | |
run: ./sh/notify.sh ${{ secrets.DATOCMS_ENDPOINT_ID }} error | |
- name: The job has succeeded | |
if: success() | |
run: ./sh/notify.sh ${{ secrets.DATOCMS_ENDPOINT_ID }} success |