From 59cf4997e4b604fecaabfebec3bbadc2fb6e3b84 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Sun, 4 Aug 2024 22:44:01 +0900 Subject: [PATCH 1/4] fix-job-need-premission --- .github/workflows/github-pages.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index 122bfd5..725fbc7 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -3,28 +3,24 @@ on: push: # branches: # - master - workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write +defaults: + run: + shell: bash concurrency: group: "pages" cancel-in-progress: false -# env: -# GITHUB_CONTAINER_REGISTRY_TAG: ryosukedtomita/github-pages-test-docker -# IMAGE_NAME: react-app - - jobs: build: runs-on: ubuntu-latest environment: name: staging + permissions: + contents: read + id-token: write steps: - name: Checkout repository @@ -51,7 +47,7 @@ jobs: echo ----[DEBUG]: END---- docker buildx bake --set react-app.args.BUILD_ENV=${environment} docker compose up -d - docker compose cp react-app:/usr/share/nginx/html build + docker compose cp react-app-container:/usr/share/nginx/html build # Deploymentsにupload - name: Upload artifact @@ -65,8 +61,12 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest + permissions: + pages: write + contents: read timeout-minutes: 10 needs: build + steps: - name: Deploy to GitHub Pages id: deployment From 99990ba8991a6ee2a2b62378929c93504ee8e6c5 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Sun, 4 Aug 2024 22:51:37 +0900 Subject: [PATCH 2/4] test --- .github/workflows/github-pages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index 725fbc7..e119969 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -19,7 +19,7 @@ jobs: environment: name: staging permissions: - contents: read + contents: write id-token: write steps: From cb3bf5be544800ef9ab43dcac1838b6928fc9371 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Sun, 4 Aug 2024 22:55:10 +0900 Subject: [PATCH 3/4] test3 --- .github/workflows/github-pages.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index e119969..fb63645 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -19,7 +19,7 @@ jobs: environment: name: staging permissions: - contents: write + contents: read id-token: write steps: @@ -47,7 +47,7 @@ jobs: echo ----[DEBUG]: END---- docker buildx bake --set react-app.args.BUILD_ENV=${environment} docker compose up -d - docker compose cp react-app-container:/usr/share/nginx/html build + docker compose cp react-app:/usr/share/nginx/html build # Deploymentsにupload - name: Upload artifact From f25f476f6a3bf3f3f6efa955a32946b2ffa0f0d3 Mon Sep 17 00:00:00 2001 From: RyosukeDTomita Date: Sun, 4 Aug 2024 22:57:17 +0900 Subject: [PATCH 4/4] test4 --- .github/workflows/github-pages.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-pages.yaml b/.github/workflows/github-pages.yaml index fb63645..77b7f4e 100644 --- a/.github/workflows/github-pages.yaml +++ b/.github/workflows/github-pages.yaml @@ -20,7 +20,6 @@ jobs: name: staging permissions: contents: read - id-token: write steps: - name: Checkout repository @@ -64,6 +63,7 @@ jobs: permissions: pages: write contents: read + id-token: write timeout-minutes: 10 needs: build