add updated QR codes (#1058) #1084
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: Deploy | |
on: | |
push: | |
branches: | |
- master | |
env: | |
NOTIFY_MATRIX: false | |
NOTIFY_TELEGRAM: true | |
GITHUB_WORKFLOW_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🛎 Checkout | |
id: checkout | |
uses: actions/checkout@v4 | |
- uses: ./.github/workflows/rust-install | |
- name: ⚙ Run verifier | |
id: verify | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --release -- verify | |
- name: ⚙ Run collector | |
id: collect | |
run: | | |
cargo run --release -- -c=config.toml collect | |
exit_code=$? | |
if [ $exit_code -eq 12 ] | |
then | |
echo "::set-output name=redeploy::true" | |
exit 0 | |
fi | |
echo "::set-output name=redeploy::false" | |
exit $exit_code | |
shell: bash {0} | |
- name: 🔑 Generate token | |
uses: tibdex/github-app-token@v1 | |
id: generate-token | |
with: | |
app_id: ${{ secrets.NOVASAMA_APP_ID }} | |
private_key: ${{ secrets.NOVASAMA_APP_PRIVATE_KEY }} | |
- uses: ./.github/workflows/deploy | |
id: deploy | |
if: success() || failure() && (steps.collect.outcome == 'failure') | |
with: | |
token: ${{ steps.generate-token.outputs.token }} | |
- name: Send warning to Matrix channel | |
uses: s3krit/matrix-message-action@v0.0.3 | |
if: steps.collect.outputs.redeploy == 'true' && env.NOTIFY_MATRIX == 'true' | |
with: | |
room_id: ${{ secrets.MATRIX_ROOM_ID }} | |
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} | |
server: ${{ secrets.MATRIX_SERVER }} | |
message: "⚠️ Warning metadata deployed but should be updated one more time! ⚠️ ${{ env.GITHUB_WORKFLOW_URL }}" | |
- name: Send warning to Telegram channel | |
uses: appleboy/telegram-action@master | |
if: steps.collect.outputs.redeploy == 'true' && env.NOTIFY_TELEGRAM == 'true' | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: "⚠️ Warning metadata deployed but should be updated one more time! ⚠️ ${{ env.GITHUB_WORKFLOW_URL }}️" | |
- name: Send error to Matrix channel | |
uses: s3krit/matrix-message-action@v0.0.3 | |
if: failure() && (steps.deploy.outcome == 'failure' || steps.verify.outcome == 'failure') && env.NOTIFY_MATRIX == 'true' | |
with: | |
room_id: ${{ secrets.MATRIX_ROOM_ID }} | |
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }} | |
server: ${{ secrets.MATRIX_SERVER }} | |
message: "❌️ Error deploying metadata! ❌ ${{ env.GITHUB_WORKFLOW_URL }}" | |
- name: Send error to Telegram channel | |
uses: appleboy/telegram-action@master | |
if: failure() && (steps.deploy.outcome == 'failure' || steps.verify.outcome == 'failure') && env.NOTIFY_TELEGRAM == 'true' | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: "❌️ Error deploying metadata! ❌ ${{ env.GITHUB_WORKFLOW_URL }}" |