name: Balout-Admin-Publish on: push: tags: - "*" # run on any tag push jobs: build: name: Run Publish Job runs-on: ubuntu-latest permissions: contents: read security-events: write actions: read packages: write id-token: write steps: - name: Checkout code uses: actions/checkout@v3 - name: Setup Docker buildx uses: docker/setup-buildx-action@v2.10.0 - name: Log into registry git.meshkee.com uses: docker/login-action@v2.2.0 with: registry: git.meshkee.com username: ${{ vars.DOCKER_USERNAME }} password: ${{ vars.DOCKER_PASSWORD }} - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@v4.2.1 with: context: . push: true tags: git.meshkee.com/${{ gitea.repository }}:${{ gitea.ref_name }} # cache-from: type=local,src=/tmp/.buildx-cache # cache-to: type=local,dest=/tmp/.buildx-cache no-cache: true secrets: | gitea_token=${{ secrets.TOKEN }} # deploy: # name: Deploy Job # runs-on: ubuntu-latest # permissions: # contents: read # security-events: write # actions: read # id-token: write # steps: # - name: Deploy to server # uses: appleboy/ssh-action@v1.0.0 # with: # host: ${{ secrets.SSH_HOST }} # username: ${{ secrets.SSH_USER }} # key: ${{ secrets.SSH_KEY }} # port: 22 # script: | # cd /apps/admin-front # docker rm -f admin-front || true # docker pull git.meshkee.com/${{ gitea.repository }}:${{ gitea.ref_name }} # sleep 5 # IMAGE=git.meshkee.com/${{ gitea.repository }}:${{ gitea.ref_name }} docker compose up -d --remove-orphans # sleep 10 # docker ps | grep admin-front # curl -I https://admin.shirinibalout.com/user/dashboard || echo "Health check failed"