From cd950d1f9f69db0333fb7b78a2c9535e2a63b3b4 Mon Sep 17 00:00:00 2001 From: hash3liZer Date: Wed, 16 Oct 2024 19:52:24 +0500 Subject: [PATCH] Deploying site --- .github/workflows/deploy.yml | 40 ++++++++++++++++++++++++++++++++++++ hugo.toml | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..45836a3 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,40 @@ +name: Publish to GH Pages +on: + push: + branches: + - main + pull_request: + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout source + uses: actions/checkout@v3 + with: + submodules: true + + - name: Checkout destination + uses: actions/checkout@v3 + if: github.ref == 'refs/heads/main' + with: + ref: gh-pages + path: built-site + + - name: Setup Hugo + run: | + curl -L -o /tmp/hugo.tar.gz 'https://github.com/gohugoio/hugo/releases/download/v0.136.0/hugo_0.136.0_linux-amd64.tar.gz' + tar -C ${RUNNER_TEMP} -zxvf /tmp/hugo.tar.gz hugo + - name: Build + run: ${RUNNER_TEMP}/hugo + + - name: Deploy + if: github.ref == 'refs/heads/main' + run: | + cp -R public/* ${GITHUB_WORKSPACE}/built-site/ + cd ${GITHUB_WORKSPACE}/built-site + git add . + git config user.name 'hash3liZer' + git config user.email 'me@shameerkashif.me' + git commit -m 'Updated site' + git push diff --git a/hugo.toml b/hugo.toml index 1e94d46..170c3bc 100644 --- a/hugo.toml +++ b/hugo.toml @@ -1,4 +1,4 @@ -baseURL = 'https://example.org/' +baseURL = 'https://team.airoverflow.com/' languageCode = 'en-us' title = 'My New Hugo Site' theme = 'nightfall' \ No newline at end of file