diff options
author | Shohei Ueda <30958501+peaceiris@users.noreply.github.com> | 2022-04-23 09:02:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-23 09:02:27 +0300 |
commit | 1b1cdb0e549c6124b02eb4a89310deed2def3954 (patch) | |
tree | a2d308bf9ddc6312e540fde13826d1080e10fcbf /.github | |
parent | 638b1769edecb31ec4c808126c849c44c3ca2622 (diff) |
ci: get hugo version from go.mod (#495)
Diffstat (limited to '.github')
-rw-r--r-- | .github/dependabot.yml | 9 | ||||
-rw-r--r-- | .github/workflows/ci.yml | 65 |
2 files changed, 40 insertions, 34 deletions
diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 545cc951..f74830f1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -33,3 +33,12 @@ updates: - "dependencies-gomod" commit-message: prefix: deps(gomod) + +- package-ecosystem: "gomod" + directory: "/deps" + schedule: + interval: "daily" + time: "11:00" + timezone: "Japan" + commit-message: + prefix: "deps" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbfc1773..3bff04ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ on: - cron: "13 13 * * *" concurrency: - group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.job }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: @@ -24,7 +24,6 @@ permissions: env: HUGO_CACHEDIR: /tmp/hugo_cache - GO_VERSION: '1.17' jobs: deploy: @@ -35,29 +34,28 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-go@v3 - with: - go-version: '${{ env.GO_VERSION }}' - - - name: Read .env - id: hugo_version + - name: Set envs + id: envs run: | . ./.env - echo "::set-output name=hugo_version::${HUGO_VERSION}" + echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}" + echo "::set-output name=GO_VERSION::${GO_VERSION}" + + - uses: peaceiris/workflows/setup-go@v0.13.0 + with: + go-version: "${{ steps.envs.outputs.GO_VERSION }}" + cache-path: | + ${{ env.HUGO_CACHEDIR }} + cache-key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} + cache-restore-keys: | + ${{ runner.os }}-hugomod- - name: Setup Hugo uses: peaceiris/actions-hugo@v2.5.0 with: - hugo-version: "${{ steps.hugo_version.outputs.hugo_version }}" + hugo-version: "${{ steps.envs.outputs.HUGO_VERSION }}" extended: true - - uses: actions/cache@v3 - with: - path: ${{ env.HUGO_CACHEDIR }} - key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-hugomod- - - uses: denoland/setup-deno@v1 with: deno-version: 'v1.x' @@ -136,7 +134,7 @@ jobs: user_name: 'github-actions[bot]' user_email: 'github-actions[bot]@users.noreply.github.com' - test-docker: + docker: runs-on: ubuntu-20.04 timeout-minutes: 2 if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' }} @@ -152,7 +150,7 @@ jobs: - run: make build - test-setup: + setup: runs-on: ubuntu-20.04 timeout-minutes: 2 if: ${{ github.ref == 'refs/heads/main' }} @@ -164,29 +162,28 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '${{ env.GO_VERSION }}' - - - name: Read .env - id: hugo_version + - name: Set envs + id: envs run: | . ./.env - echo "::set-output name=hugo_version::${HUGO_VERSION}" + echo "::set-output name=HUGO_VERSION::${HUGO_VERSION}" + echo "::set-output name=GO_VERSION::${GO_VERSION}" + + - uses: peaceiris/workflows/setup-go@v0.13.0 + with: + go-version: "${{ steps.envs.outputs.GO_VERSION }}" + cache-path: | + ${{ env.HUGO_CACHEDIR }} + cache-key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} + cache-restore-keys: | + ${{ runner.os }}-hugomod- - name: Setup Hugo uses: peaceiris/actions-hugo@v2.5.0 with: - hugo-version: "${{ steps.hugo_version.outputs.hugo_version }}" + hugo-version: "${{ steps.envs.outputs.HUGO_VERSION }}" extended: ${{ matrix.extended }} - - uses: actions/cache@v3 - with: - path: ${{ env.HUGO_CACHEDIR }} - key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-hugomod- - - name: Setup Git run: | git config --global user.email "github-actions[bot]@users.noreply.github.com" |