Update actions/setup-node action to v6.2.0 #823
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: build | |
| on: | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| - closed | |
| branches: | |
| - main | |
| push: | |
| branches: | |
| - main | |
| permissions: {} | |
| jobs: | |
| update-go-version: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| run: bash "${GITHUB_WORKSPACE}/scripts/build/update_go_version/update_go_version.sh" | |
| env: | |
| HEAD_REF: ${{github.head_ref || github.event.release.tag_name}} | |
| - uses: dev-hato/actions-diff-pr-management@9de3de40217217a73ac95f3751d7bfe1c9f23ead # v2.2.3 | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| branch-name-prefix: fix-go-version | |
| pr-title-prefix: Goのバージョンを直してあげたよ! | |
| build_docker_image: | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKER_BUILDKIT: 1 | |
| COMPOSE_DOCKER_CLI_BUILD: 1 | |
| REPOSITORY: ${{github.repository}} | |
| permissions: | |
| contents: read | |
| packages: write | |
| if: github.event_name == 'release' || (github.event_name == 'pull_request' && github.event.action != 'closed' && github.repository == github.event.pull_request.head.repo.full_name) | |
| needs: update-go-version | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - run: cp .env.example .env | |
| - uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0 | |
| - uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 | |
| - run: echo "TAG_NAME=${HEAD_REF//\//-}" >> "$GITHUB_ENV" | |
| env: | |
| HEAD_REF: ${{github.head_ref}} | |
| if: ${{ github.event_name == 'pull_request' }} | |
| - run: echo "TAG_NAME=${GITHUB_EVENT_RELEASE_TAG_NAME}" >> "$GITHUB_ENV" | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| GITHUB_EVENT_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} | |
| - name: Build and push (dev) | |
| uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 | |
| env: | |
| DOCKER_CONTENT_TRUST: 1 | |
| with: | |
| push: true | |
| files: docker-compose.yml,dev.docker-compose.yml | |
| source: . | |
| - name: Build and push (main) | |
| uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 | |
| env: | |
| DOCKER_CONTENT_TRUST: 1 | |
| with: | |
| push: true | |
| files: docker-compose.yml | |
| source: . | |
| - run: echo 'TAG_NAME=latest' >> "$GITHUB_ENV" | |
| if: ${{ github.event_name == 'release' }} | |
| - name: Build and push (dev) (latest) | |
| uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| DOCKER_CONTENT_TRUST: 1 | |
| with: | |
| push: true | |
| files: docker-compose.yml,dev.docker-compose.yml | |
| source: . | |
| - name: Build and push (main) (latest) | |
| uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0 | |
| if: ${{ github.event_name == 'release' }} | |
| env: | |
| DOCKER_CONTENT_TRUST: 1 | |
| with: | |
| push: true | |
| files: docker-compose.yml | |
| source: . | |
| # package.jsonに差分があれば、package.jsonからpackage-lock.jsonを作り出す | |
| # jscpd:ignore-start | |
| pr-check-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| with: | |
| cache: npm | |
| node-version-file: package.json | |
| - if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| run: bash "${GITHUB_WORKSPACE}/scripts/build/npm_install.sh" | |
| # jscpd:ignore-end | |
| - uses: dev-hato/actions-diff-pr-management@9de3de40217217a73ac95f3751d7bfe1c9f23ead # v2.2.3 | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| branch-name-prefix: npm | |
| pr-title-prefix: package.jsonやpackage-lock.jsonが更新されたので直してあげたよ! | |
| update-dockle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| if: github.event_name != 'pull_request' || github.event.action != 'closed' | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| persist-credentials: false | |
| - uses: dev-hato/actions-update-dockle@e77226c2707af34a4116dbaa5423bee7e5a559d7 # v0.0.130 | |
| with: | |
| github-token: ${{secrets.GITHUB_TOKEN}} | |
| dockle: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - update-dockle | |
| - build_docker_image | |
| env: | |
| DOCKER_CONTENT_TRUST: 1 | |
| REPOSITORY: ${{github.repository}} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - run: bash "${GITHUB_WORKSPACE}/scripts/build/dockle/run_dockle.sh" | |
| env: | |
| HEAD_REF: ${{github.head_ref || github.event.release.tag_name}} | |
| build-complete: | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - pr-check-npm | |
| - update-dockle | |
| - dockle | |
| steps: | |
| - if: needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || github.event.action == 'closed' || (needs.pr-check-npm.result == 'success' && needs.dockle.result == 'success')) | |
| run: exit 0 | |
| - if: ${{ !(needs.update-dockle.result == 'success' && (github.event_name == 'push' || (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name) || github.event.action == 'closed' || (needs.pr-check-npm.result == 'success' && needs.dockle.result == 'success'))) }} | |
| run: exit 1 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true |