Skip to content

.github/workflows/signbank-extract.yml #38

.github/workflows/signbank-extract.yml

.github/workflows/signbank-extract.yml #38

on:
workflow_dispatch:
schedule:
# Run monthly at 1PM UTC (~ 1AM NZT)
- cron: 0 13 1 * *
jobs:
extract:
runs-on: ubuntu-latest
name: 'Extracts and prepares Signbank data for use by native applications'
steps:
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- uses: actions/checkout@v4
- run: make build update_signbank_assets
env:
SIGNBANK_HOST: ${{ secrets.SIGNBANK_HOST }}
SIGNBANK_USERNAME: ${{ secrets.SIGNBANK_USERNAME }}
SIGNBANK_PASSWORD: ${{ secrets.SIGNBANK_PASSWORD }}
- run: tar -cf assets.tar.gz assets
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: signbank-${{steps.date.outputs.date}}
release_name: Monthly release of NZSL Signbank data as at ${{steps.date.outputs.date}}
body: |
Every quarter, the native dictionary applications are updated from the main
NZSL Dictionary from this release. If you wish to use a 'snapshot' of the dictionary,
these files may be useful.
NZSL Dictionary data by Deaf Studies Research Unit, Victoria University of Wellington is licensed under
a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./assets.tar.gz
asset_name: assets.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nzsl.db
asset_name: nzsl.db
asset_content_type: application/vnd.sqlite3
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./nzsl.dat
asset_name: nzsl.dat
asset_content_type: text/plain
- name: Create LATEST_RELEASE_DATE file
run: echo "${{steps.date.outputs.date}}" > LATEST_RELEASE_DATE
- name: Configure git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
- name: Commit and push LATEST_RELEASE_DATE file
run: |
git add LATEST_RELEASE_DATE
git commit -m "Release ${{steps.date.outputs.date}}"
git push
- name: Report to Slack
if: always()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://github.com/ackama.png?size=48
SLACK_USERNAME: 'Signbank Exporter'
SLACK_FOOTER: ''
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE:
"${{ format('{0} job result: {1}', github.job, job.status) }}"