diff --git a/.github/workflows/publish-dev.yml b/.github/workflows/publish-dev.yml new file mode 100644 index 0000000..07a8f36 --- /dev/null +++ b/.github/workflows/publish-dev.yml @@ -0,0 +1,35 @@ +# This GitHub Action publishes the dev branch to +# u-a-t-p.github.io/demoland-web/dev. + +name: publish-website-dev +on: + push: + branches: + - dev + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Set up Node.JS + uses: actions/setup-node@v3 + with: + node-version: 21 + + - name: Checkout dev branch + uses: actions/checkout@v3 + with: + ref: dev + + - name: Build dev branch + run: | + npm ci + npm run build_all github_dev + + - name: Publish build files to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: /tmp/demoland-web/dev + destination_dir: dev diff --git a/.github/workflows/publish-main.yml b/.github/workflows/publish-main.yml new file mode 100644 index 0000000..b6206a4 --- /dev/null +++ b/.github/workflows/publish-main.yml @@ -0,0 +1,35 @@ +# This GitHub Action publishes the main branch to +# u-a-t-p.github.io/demoland-web. + +name: publish-website +on: + push: + branches: + - main + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Set up Node.JS + uses: actions/setup-node@v3 + with: + node-version: 21 + + - name: Checkout main branch + uses: actions/checkout@v3 + with: + ref: main + + - name: Build main branch + run: | + npm ci + npm run build_all github + + - name: Publish all built versions to gh-pages branch + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: /tmp/demoland-web + keep_files: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index ea0cecd..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,59 +0,0 @@ -# This GitHub Action publishes: -# - the main branch to u-a-t-p.github.io/demoland-web -# - the dev branch to u-a-t-p.github.io/demoland-web/dev -# - the v1 tag to u-a-t-p.github.io/demoland-web/v1 - -name: publish-website -on: - push: - branches: - - main - - dev - -jobs: - publish: - runs-on: ubuntu-latest - - steps: - - name: Set up Node.JS - uses: actions/setup-node@v3 - with: - node-version: 21 - - - name: Checkout main branch - uses: actions/checkout@v3 - with: - ref: main - - - name: Build main branch - run: | - npm ci - npm run build_all github - - - name: Checkout dev branch - uses: actions/checkout@v3 - with: - ref: dev - - - name: Build dev branch - run: | - npm ci - npm run build_all github_dev - - - name: Checkout v1.0 tag - uses: actions/checkout@v3 - with: - ref: v1.0 - - - name: Build v1.0 tag - run: | - # note: just do this manually because the current shell scripts used - # for building were not in place at this time. - npm ci - npm run build -- --outDir='/tmp/demoland-web/v1.0' --base='/demoland-web/v1.0' - - - name: Publish all built versions to gh-pages branch - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: /tmp/demoland-web