From c17a4296c5ac542e80a8f2a5904bd460840c320a Mon Sep 17 00:00:00 2001 From: Oliver Ni Date: Tue, 3 Oct 2023 02:01:23 -0700 Subject: [PATCH] add ci --- .github/workflows/deploy.yaml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..e8f4944 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,43 @@ +name: Build and Deploy + +on: + push: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + environment: + name: Production + url: https://berkeley.mt/ + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install node + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install node dependencies + run: npm install + + - name: Install zola + run: > + wget -q -O - + "https://github.com/getzola/zola/releases/download/v0.17.2/zola-v0.17.2-x86_64-unknown-linux-gnu.tar.gz" + | tar xzf - -C /usr/local/bin + + - name: Build site + run: npm run build + + - name: Deploy + uses: burnett01/rsync-deployments@6.0.0 + with: + switches: -avPh --delete + path: public/ + remote_path: ~/public_html/new + remote_host: tsunami.ocf.berkeley.edu + remote_user: bmt + remote_key: ${{ secrets.SSH_PRIVATE_KEY }}