Release #95
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tags: | |
description: "Version tags" | |
schedule: | |
- cron: "0 */4 * * *" # Runs every 4 hours | |
push: | |
branches: [main] | |
env: | |
VERSION: 0.9.0 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Copy source for distribution | |
run: | | |
cp -r . ../dist | |
rm -rf ../dist/.git | |
- name: Copy source to development | |
run: | | |
cp -r ../dist ./docker/development/app | |
cp ./online-dev.env ./docker/development/app/.env | |
# - name: Copy source to production | |
# run: | | |
# cp -r ../dist ./docker/production/app | |
# cp ./online.env ./docker/production/app/.env | |
- name: Get Version | |
run: | | |
echo VERSION=$(cat ./app.yao |grep 'version' | awk -F '"' '{print $4}') >> $GITHUB_ENV | |
- name: Check Version | |
run: echo $VERSION | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_TOKEN }} | |
- name: Build Development | |
uses: docker/build-push-action@v5 | |
with: | |
context: ./docker/development | |
platforms: linux/amd64 | |
push: true | |
tags: yaoapp/xgen-dev:${{ env.VERSION }}-amd64-dev | |
# - name: Build Production | |
# uses: docker/build-push-action@v5 | |
# with: | |
# context: ./docker/production | |
# platforms: linux/amd64 | |
# push: true | |
# tags: yaoapp/xgen-pro:${{ env.VERSION }}-amd64 | |
# https://xgen-dev.iqka.com | |
- name: Deploy Development | |
uses: appleboy/[email protected] | |
with: | |
host: 139.199.30.36 | |
port: 22 | |
username: root | |
key: ${{ secrets.SSH_KEY }} | |
script: | | |
/data/docker/bin/deploy.sh yaoapp xgen-dev ${{ env.VERSION }}-amd64-dev | |
docker exec xgen-dev sh -c 'yao migrate --reset --force' | |
docker exec xgen-dev sh -c 'yao run scripts.init.setData' |