diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml new file mode 100644 index 0000000..8fc33b6 --- /dev/null +++ b/.github/workflows/staging.yml @@ -0,0 +1,39 @@ +name: Deploy to staging server + +on: + push: + branches: ["develop"] + +permissions: + contents: read + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + cache-version: 0 # Increment this number if you need to re-download cached gems + - name: Build with Jekyll + run: bundle exec jekyll build --baseurl "https://www.pencethren.org/~wutan/" + env: + JEKYLL_ENV: staging + - name: Deploy to server + uses: appleboy/scp-action@v0.1.4 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.KEY }} + source: "./_site/*" + target: public_html + overwrite: true + diff --git a/_layouts/default.html b/_layouts/default.html index 057a696..3a31594 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -5,6 +5,9 @@ {% if page.title %}{{ page.title }} – {% endif %}{{ site.title }} – {{ site.description }} {% seo title=false %} {% include meta.html %} + {% if jekyll.environment == 'staging' %} + + {% endif %}
+ {% if jekyll.environment == 'staging'%} + + {% endif %}