update crafty #340
Workflow file for this run
This file contains hidden or 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: release zip to appstore page | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: remove all file except docker yaml and json | |
run: find . -type f -not \( -name '*.yaml' -or -name '*.yml' -or -name 'category-list.json' -or -name 'recommend-list.json' -or -name 'README.md' -or -name '*.sh' \) -delete | |
- name: create a build with sysroot | |
id: build | |
run: | | |
rm -rf /tmp/build | |
mkdir -p /tmp/build/sysroot/var/lib/casaos/appstore/default.new | |
cp -rv build/* /tmp/build/ | |
cp -rv Apps /tmp/build/sysroot/var/lib/casaos/appstore/default.new/ | |
cp -v category-list.json /tmp/build/sysroot/var/lib/casaos/appstore/default.new/ | |
cp -v recommend-list.json /tmp/build/sysroot/var/lib/casaos/appstore/default.new/ | |
cp -v README.md /tmp/build/sysroot/var/lib/casaos/appstore/default.new/ | |
pushd /tmp | |
zip -r main.zip build | |
- name: Verify ZIP | |
if: github.ref != 'refs/heads/main' | |
run: ls -lh /tmp/main.zip | |
- name: Checkout pages | |
if: github.ref == 'refs/heads/main' | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: pages | |
- name: Copy build to pages | |
if: github.ref == 'refs/heads/main' | |
run: | | |
cp /tmp/main.zip pages/store/main.zip | |
- name: Pushes to another repository | |
if: github.ref == 'refs/heads/main' | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB2 }} | |
with: | |
source-directory: 'pages' | |
destination-github-username: 'IceWhaleTech' | |
destination-repository-name: 'CasaOS-AppStore' | |
target-branch: 'gh-pages' | |
user-email: wiki@casaos.io | |
target-directory: '' | |
- name: Upload to oss | |
if: github.ref == 'refs/heads/main' | |
id: upload_to_oss | |
uses: tvrcgo/upload-to-oss@master | |
with: | |
key-id: ${{ secrets.OSS_KEY_ID }} | |
key-secret: ${{ secrets.OSS_KEY_SECRET }} | |
region: oss-cn-shanghai | |
bucket: casaos | |
assets: | | |
/tmp/main.zip:/store/main.zip |