Skip to content

update-resource

update-resource #4214

name: update-resource
on:
push:
paths:
- .github/workflows/update-resource.yml
workflow_dispatch:
concurrency:
cancel-in-progress: false
group: update-resource@MaaRelease
jobs:
CC_n8n:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
check-latest: true
- name: Fire the webhook of MAA_S3
if: github.repository == 'MaaAssistantArknights/MaaRelease'
run: |
node scripts/AnnAngela/webhookForCC_n8n.js
env:
WEBHOOK_URL: https://workflow.maa-org.net/webhook/MaaResource
WEBHOOK_SECRET: ${{ format('{0} {1}', 'MaaRelease', secrets.CC_N8N_CREDENTIAL) }}
CC_gitlab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: MaaAssistantArknights/MaaResource
ssh-key: ${{secrets.MAA_RESOURCE_DEPLOY}}
- name: Push to GitLab
uses: SvanBoxel/gitlab-mirror-and-ci-action@master
with:
args: "https://gitlab.maa-org.net/MaaAssistantArknights/MaaResource"
env:
FOLLOW_TAGS: "false"
FORCE_PUSH: "false"
GITLAB_HOSTNAME: "gitlab.maa-org.net"
GITLAB_USERNAME: ${{ secrets.GITLAB_BOT_NAME }}
GITLAB_PASSWORD: ${{ secrets.GITLAB_BOT_PASSWORD }}
GITLAB_PROJECT_ID: "1"
ota:
runs-on: ubuntu-latest
needs:
- CC_n8n
steps:
- name: Setup ssh key
env:
SSH_PRIVATE_KEY: ${{ secrets.OTA_SERVER_SSH_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" >> ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa -H ${{ secrets.OTA_SERVER_SSH_HOST }} >> ~/.ssh/known_hosts
- name: Update Resource
run: |
ssh ${{ secrets.OTA_SERVER_SSH_USER }}@${{ secrets.OTA_SERVER_SSH_HOST }} \
"
set -e
sh ~/MaaRelease/scripts/update_resource/updateResource.sh
"