Skip to content

Commit

Permalink
Merge pull request #60 from nspcc-dev/workflows
Browse files Browse the repository at this point in the history
Workflows
  • Loading branch information
roman-khimov authored May 28, 2024
2 parents 9d0d012 + 29fb858 commit e83acb0
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Build and deploy

on:
pull_request:
branches:
- master
types: [opened, synchronize]
push:
# Build for the master branch.
branches:
- master
release:
# Publish released commit
types:
- published
workflow_dispatch:
inputs:
ref:
description: 'Ref to build [default: triggered event; examples: v0.92.0, 0a4ff9d3e4a9ab432fd5812eb18c98e03b5a7432]'
required: false
default: ''
deploy:
description: 'Deploy to production [default: false; examples: true, false]'
required: false
default: 'false'

jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
# Allows to fetch all history for all branches and tags. Need this for proper versioning.
fetch-depth: 0

- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: 'latest'

- name: Build
run: make release

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: nspcc.io
path: ./nspcc.io-*.tar.gz
if-no-files-found: error

- name: Set up Python
if: ${{ github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') }}
uses: actions/setup-python@v4
with:
python-version: '3.11.6'

- name: Publish to NeoFS
if: ${{ github.event_name == 'release' || github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true') }}
uses: nspcc-dev/gh-push-to-neofs@master
with:
NEOFS_WALLET: ${{ secrets.NEOFS_WALLET }}
NEOFS_WALLET_PASSWORD: ${{ secrets.NEOFS_WALLET_PASSWORD }}
NEOFS_NETWORK_DOMAIN: ${{ vars.NEOFS_NETWORK_DOMAIN }}
NEOFS_HTTP_GATE: ${{ vars.NEOFS_HTTP_GATE }}
STORE_OBJECTS_CID: ${{ vars.STORE_OBJECTS_CID }}
PATH_TO_FILES_DIR: nspcc.io
STRIP_PREFIX: true
REPLACE_CONTAINER_CONTENTS: true

- name: Attach binary to the release as an asset
if: ${{ github.event_name == 'release' }}
run: gh release upload ${{ github.event.release.tag_name }} ./nspcc.io-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: NSPCC DCO check

on:
pull_request:
branches: [ "master" ]

jobs:
check_commits:
uses: nspcc-dev/.github/.github/workflows/dco.yml@master

0 comments on commit e83acb0

Please sign in to comment.