Skip to content

Commit

Permalink
WIP: Add new workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinkrzeminski committed Sep 17, 2024
1 parent 363364e commit dc7ed95
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy-to-stream-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to xwp/stream-dist Repository

on: push

jobs:
deploy_to_stream_dist:
name: Deploy to xwp/stream-dist
runs-on: ubuntu-22.04
permissions:
contents: write
packages: read

steps:
- name: Push to xwp/stream-dist
run: |
set -ex
# Set up the environment.
ROOT_DIR="$(git rev-parse --show-toplevel)"
WORKING_BRANCH="$(git rev-parse --abbrev-ref HEAD)"
SRC_DIR="$ROOT_DIR/build"
DIST_DIR="$ROOT_DIR/dist"
DIST_REPO="[email protected]:xwp/stream-dist.git"
DIST_BRANCH="${GITHUB_REF#refs/heads/}"
DIST_TAG="${GITHUB_REF#refs/tags/}"
COMMIT_MESSAGE="$(git log -1 --oneline)"
export GIT_DIR="$DIST_DIR/.git"
export GIT_WORK_TREE="$DIST_DIR"
rm -rf "$SRC_DIR"
rm -rf "$DIST_DIR"
mkdir -p "$SRC_DIR"
mkdir -p "$DIST_DIR"
rsync -av --exclude-from=.distignore "$ROOT_DIR/" "$SRC_DIR/"
git clone --progress --verbose "$DIST_REPO" "$DIST_DIR/.git"
git checkout -B "$DIST_BRANCH"
# Use the release bundle as the work tree.
export GIT_WORK_TREE="$SRC_DIR"
git add --all
git commit --allow-empty --message "$COMMIT_MESSAGE"
# Debug
git status
ls -al "$SRC_DIR"
ls -al "$DIST_DIR"

0 comments on commit dc7ed95

Please sign in to comment.