Skip to content

bullenetwork-v2.2.2 #72

bullenetwork-v2.2.2

bullenetwork-v2.2.2 #72

name: eebulle.ch deploy
on:
release:
types: [published]
jobs:
deploy:
if: ${{ startsWith(github.event.release.tag_name, 'eebulle-') }}
runs-on: ubuntu-latest
env:
base_folder: eebulle.ch
hodor_url: https://hodor.doxatech.ch
hodor_key: eebulle
defaults:
run:
working-directory: ./${{ env.base_folder }}
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: |
echo ::set-output name=version::$(echo ${GITHUB_REF/refs\/tags\//})
echo ::set-output name=version_file::$(echo ${GITHUB_REF/refs\/tags\//} | tr . _)
echo "::set-output name=shortsha::$(git rev-parse --short ${GITHUB_SHA})"
echo "::set-output name=buildurl::${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
echo "::set-output name=date::$(date +'%d/%m/%y %H:%M')"
- uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: |
npm install
npm install -g gatsby-cli
- name: Build
env:
GATSBY_DIRECTUS_ENDPOINT: https://vanil.bullenetwork.ch
GATSBY_APP_VERSION: ${{ steps.get_version.outputs.version }}
GATSBY_BUILD_URL: ${{ steps.get_version.outputs.buildurl }}
GATSBY_SHORT_SHA: ${{ steps.get_version.outputs.shortsha }}
GATSBY_BUILD_DATE: ${{ steps.get_version.outputs.date }}
run: |
gatsby build
- name: Create tar.gz
run: |
tar -czvf ${{ steps.get_version.outputs.version_file }}.tar.gz public
- name: Release
id: release_pub
# at this time of writing, the latest version does not contain the assets
# output
uses: softprops/action-gh-release@cd28b0f5ee8571b76cfdaa62a30d51d752317477
if: startsWith(github.ref, 'refs/tags/')
with:
files: ${{ env.base_folder }}/eebulle-*.tar.gz
- name: Trigger deploy
run: |
curl -X POST -u hodor:${{ secrets.HODOR_PASSWORD }} -d "{\"browser_download_url\":\"${{ fromJSON(steps.release_pub.outputs.assets)[0].browser_download_url }}\",\"tag\":\"${{ steps.get_version.outputs.version }}\"}" ${{ env.hodor_url }}/api/hook/${{ env.hodor_key }}