Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Change default branch from master to main #357

Merged
merged 2 commits into from
May 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- master
- main
paths-ignore:
- "README.md"
pull_request:
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
uses: nwtgck/[email protected]
with:
publish-dir: './exampleSite/public'
production-branch: master
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
enable-pull-request-comment: true
Expand All @@ -73,7 +73,7 @@ jobs:

- name: Deploy
uses: peaceiris/[email protected]
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
with:
#deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -84,7 +84,7 @@ jobs:

lighthouse:
needs: deploy
if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-18.04
timeout-minutes: 2
steps:
Expand Down
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Find Similar Issues or Pull Requests](#find-similar-issues-or-pull-requests)
- [Develop](#develop)
- [Create Commit and Push](#create-commit-and-push)
Expand Down Expand Up @@ -57,6 +56,6 @@ On Github.

```sh
git remote add upstream https://github.com/peaceiris/hugo-theme-iris.git
git checkout master
git pull upstream master
git checkout main
git pull upstream main
```
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ Hugo IRIS Theme
</h2>

<div align="center">
<img src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/images/tn.png" alt="Hugo Iris Theme thumbnail" width="500px">
<img src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/images/tn.png" alt="Hugo Iris Theme thumbnail" width="500px">
</div>

[![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/peaceiris/hugo-theme-iris/blob/master/LICENSE)
[![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/peaceiris/hugo-theme-iris/blob/main/LICENSE)
[![release](https://img.shields.io/github/release/peaceiris/hugo-theme-iris.svg)](https://github.com/peaceiris/hugo-theme-iris/releases/latest)
[![release date](https://img.shields.io/github/release-date/peaceiris/hugo-theme-iris.svg)](https://github.com/peaceiris/hugo-theme-iris/releases)
[![release feed](https://img.shields.io/badge/release-feed-yellow)](https://github.com/peaceiris/hugo-theme-iris/releases.atom)
![deploy status](https://github.com/peaceiris/hugo-theme-iris/workflows/CI/badge.svg?branch=master&event=push)
![deploy status](https://github.com/peaceiris/hugo-theme-iris/workflows/CI/badge.svg?branch=main&event=push)
[![hugo themes](https://img.shields.io/static/v1?label=Hugo%20Themes&message=IRIS&color=blueviolet)](https://themes.gohugo.io/hugo-theme-iris/)
[![lighthouse score](https://img.shields.io/static/v1?label=Lighthouse%20Score&message=Good&color=green)](https://hugothemeiris.peaceiris.app/report.html)

Expand Down Expand Up @@ -114,7 +114,7 @@ This repository includes a [Hugo] theme.

You can find the minimum supported Hugo version in [theme.toml] `min_version`. Using Hugo extended version is desirable.

[theme.toml]: https://github.com/peaceiris/hugo-theme-iris/blob/master/theme.toml
[theme.toml]: https://github.com/peaceiris/hugo-theme-iris/blob/main/theme.toml

### Install Go

Expand All @@ -124,11 +124,11 @@ This theme depends on Hugo Modules.

### Initialize New Hugo Project

Here is [the setup script](https://github.com/peaceiris/hugo-theme-iris/blob/master/scripts/setup.sh).
Here is [the setup script](https://github.com/peaceiris/hugo-theme-iris/blob/main/scripts/setup.sh).

```sh
mkdir homepage
wget https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/scripts/setup.sh
wget https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/scripts/setup.sh
bash ./setup.sh homepage "your_github_id"
cd homepage
hugo server
Expand Down Expand Up @@ -242,7 +242,7 @@ If your logo image is located at `assets/images/logo.jpg`.
{{< circle src="images/logo.jpg" alt="hugo-theme-iris logo" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_circle.jpg" alt="Shortcode mermaid">
<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_circle.jpg" alt="Shortcode mermaid">

### button

Expand All @@ -255,7 +255,7 @@ If your logo image is located at `assets/images/logo.jpg`.
</div>
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_button.jpg" alt="Shortcode button">
<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_button.jpg" alt="Shortcode button">

### mermaid

Expand All @@ -275,7 +275,7 @@ sequenceDiagram
{{< /mermaid >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_mermaid.jpg" alt="Shortcode mermaid">
<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_mermaid.jpg" alt="Shortcode mermaid">

### repo

Expand All @@ -284,7 +284,7 @@ The script requires the [gh] command.

[gh]: https://github.com/cli/cli

For more details: [scripts/fetch_data.sh](https://github.com/peaceiris/hugo-theme-iris/blob/master/exampleSite/scripts/fetch_data.sh)
For more details: [scripts/fetch_data.sh](https://github.com/peaceiris/hugo-theme-iris/blob/main/exampleSite/scripts/fetch_data.sh)

```sh
brew install gh
Expand All @@ -305,7 +305,7 @@ We can show a repository card like as follows.
{{< repo id="peaceiris" name="actions-hugo" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_repo.jpg" alt="Shortcode repo">
<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_repo.jpg" alt="Shortcode repo">

### github-sponsors-list

Expand All @@ -315,7 +315,7 @@ Please follow the instruction as the same as the `repo` shortcode.
{{< github-sponsors-list id="peaceiris" >}}
```

<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_github-sponsors-list.jpg" alt="Shortcode github-sponsors-list">
<img width="500px" src="https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_github-sponsors-list.jpg" alt="Shortcode github-sponsors-list">

### table

Expand All @@ -330,7 +330,7 @@ Please follow the instruction as the same as the `repo` shortcode.

| Mouse out | Mouse over |
|---|---|
| ![Shortcode table mouse out](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_table_1.jpg) | ![Shortcode table mouse over](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/master/exampleSite/assets/images/shortcode_table_2.jpg) |
| ![Shortcode table mouse out](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_table_1.jpg) | ![Shortcode table mouse over](https://raw.githubusercontent.com/peaceiris/hugo-theme-iris/main/exampleSite/assets/images/shortcode_table_2.jpg) |

### math

Expand Down Expand Up @@ -381,7 +381,7 @@ git commit -m "deps: bump hugo-theme-iris"

## Changelog

- [hugo-theme-iris/CHANGELOG.md](https://github.com/peaceiris/hugo-theme-iris/blob/master/CHANGELOG.md)
- [hugo-theme-iris/CHANGELOG.md](https://github.com/peaceiris/hugo-theme-iris/blob/main/CHANGELOG.md)



Expand All @@ -401,7 +401,7 @@ You can find more detail in our [Contributing Guide].

## License

- [MIT License - peaceiris/hugo-theme-iris](https://github.com/peaceiris/hugo-theme-iris/blob/master/LICENSE)
- [MIT License - peaceiris/hugo-theme-iris](https://github.com/peaceiris/hugo-theme-iris/blob/main/LICENSE)



Expand All @@ -418,7 +418,7 @@ You can find more detail in our [Contributing Guide].


<!-- Internal References -->
[Contributing Guide]: https://github.com/peaceiris/hugo-theme-iris/blob/master/CONTRIBUTING.md
[Contributing Guide]: https://github.com/peaceiris/hugo-theme-iris/blob/main/CONTRIBUTING.md

<!-- External References -->
[Hugo]: https://gohugo.io/
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/config/_default/params.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repo:
URL: "https://github.com/peaceiris/hugo-theme-iris"
branch: master
branch: main
contentDir: exampleSite/content

themeColor: "#ffffff" # smart phone's browser tab color
Expand Down
28 changes: 0 additions & 28 deletions exampleSite/content/en/posts/github-pages-and-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,3 @@ This deploy action can be combined simply and freely with [Static Site Generator
```

The above example step will deploy `./public` directory to `gh-pages` branch.



## Example Workflow

Here is an example workflow for Hugo project.
Creat YAML file `.github/workflows/gh-pages.yml` and push to your remote default branch.

```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./public
```

### Deploy to master branch

For `<username>.github.io` repository.

```yaml
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: master
publish_dir: ./public
```
2 changes: 1 addition & 1 deletion exampleSite/static/admin/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
backend:
name: github
repo: peaceiris/hugo-theme-iris
branch: master
branch: main
# squash_merges: true

media_folder: "static/images"
Expand Down
8 changes: 4 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function print_info() {
echo -e "\e[36mINFO: ${1}\e[m"
}

if [ "$(git branch --show-current)" != "master" ]; then
echo "$0: Current branch is not master" 1>&2
if [ "$(git branch --show-current)" != "main" ]; then
echo "$0: Current branch is not main" 1>&2
exit 1
fi

Expand All @@ -30,7 +30,7 @@ if [ "${res}" = "n" ]; then
fi

git fetch origin
git pull origin master
git pull origin main
git pull origin --tags

npm ci
Expand All @@ -47,5 +47,5 @@ fi
npm run release -- --release-as "${RELEASE_TYPE}" --preset eslint

TAG_NAME="v$(jq -r '.version' ./package.json)"
git push origin master
git push origin main
git push origin "${TAG_NAME}"
10 changes: 5 additions & 5 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ set -eu -o pipefail # -x: is for debugging

cd $1
git init
wget https://github.com/peaceiris/hugo-theme-iris/archive/master.zip
unzip master.zip
rm master.zip
cp -r ./hugo-theme-iris-master/exampleSite/{assets,config,content,data,static,.gitignore} .
rm -rf hugo-theme-iris-master
wget https://github.com/peaceiris/hugo-theme-iris/archive/main.zip
unzip main.zip
rm main.zip
cp -r ./hugo-theme-iris-main/exampleSite/{assets,config,content,data,static,.gitignore} .
rm -rf hugo-theme-iris-main
hugo mod init "github.com/$2/$1"
hugo mod get -u github.com/peaceiris/hugo-theme-iris
git add .
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Iris"
license = "MIT"
licenselink = "https://github.com/peaceiris/hugo-theme-iris/blob/master/LICENSE"
licenselink = "https://github.com/peaceiris/hugo-theme-iris/blob/main/LICENSE"
description = "Hugo Iris Theme - Portfolio and Blog"
homepage = "https://github.com/peaceiris/hugo-theme-iris"
min_version = "0.83.1"
Expand Down