Skip to content

Commit

Permalink
ci: Update themes-preview
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Jul 10, 2021
1 parent ed90085 commit dc28c65
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:

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

lighthouse:
needs: deploy
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-18.04
timeout-minutes: 2
steps:
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:
test-docker:
runs-on: ubuntu-18.04
timeout-minutes: 2
if: github.event_name == 'push' || github.event_name == 'pull_request'
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }}
steps:
- uses: actions/[email protected]

Expand All @@ -140,7 +140,7 @@ jobs:
test-setup:
runs-on: ubuntu-18.04
timeout-minutes: 2
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' }}
strategy:
matrix:
extended:
Expand Down Expand Up @@ -183,12 +183,13 @@ jobs:
hugo
themes-preview:
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-18.04
timeout-minutes: 3
steps:
- uses: actions/[email protected]
with:
repository: gohugoio/hugoThemes
repository: gohugoio/hugoThemesSiteBuilder

- name: Setup Hugo
uses: peaceiris/[email protected]
Expand All @@ -203,32 +204,24 @@ jobs:
restore-keys: |
${{ runner.os }}-hugomod-
- name: Checkout hugo-iris-theme main
run: git submodule update --init --remote hugo-theme-iris

- name: Checkout hugo-iris-theme pull/${{ github.event.number }}
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd hugo-theme-iris
gh pr checkout ${{ github.event.number }}
- name: Overwrite themes.txt
run: echo "github.com/peaceiris/hugo-theme-iris" > themes.txt

- name: Build
working-directory: ./cmd/hugothemesitebuilder/build/site
env:
BASE_URL: https://hugo-theme-iris-themes-preview.netlify.app
DEPLOY_PRIME_URL: https://hugo-theme-iris-themes-preview.netlify.app
run: |
(cd ./_script && ./generateThemeSite.sh "${BASE_URL}")
hugo -s _script/hugoThemeSite/themeSite --baseURL "/"
cat << EOF > ./_script/hugoThemeSite/themeSite/public/robots.txt
bash ./build.sh
cat << EOF > ./public/robots.txt
User-agent: *
Disallow: /
EOF
- name: Deploy to Netlify
uses: nwtgck/[email protected]
with:
publish-dir: './_script/hugoThemeSite/themeSite/public'
publish-dir: './public'
production-branch: main
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: "Deploy from GitHub Actions"
Expand Down

0 comments on commit dc28c65

Please sign in to comment.