diff --git a/.github/workflows/publish_deb.yaml b/.github/workflows/publish_deb.yaml index b83ca6c..3338263 100644 --- a/.github/workflows/publish_deb.yaml +++ b/.github/workflows/publish_deb.yaml @@ -4,6 +4,10 @@ on: release: types: [published] +# Uploads the .deb packages to the GitHub release. +permissions: + contents: write + jobs: docker-release: runs-on: ubuntu-latest diff --git a/.github/workflows/publish_docker.yaml b/.github/workflows/publish_docker.yaml index b591949..c319a10 100644 --- a/.github/workflows/publish_docker.yaml +++ b/.github/workflows/publish_docker.yaml @@ -1,4 +1,4 @@ -name: Publish on dockerhub and quay.io +name: Publish on dockerhub on: release: @@ -7,22 +7,21 @@ on: jobs: docker-release: runs-on: ubuntu-latest + # Docker Hub credentials are scoped to this environment (default branch / release tags only). + environment: release-ci steps: - name: Checkout uses: actions/checkout@v2 with: fetch-depth: 0 - - name: Login to Docker and Quay + - name: Login to Docker Hub if: success() run: | printf ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin - printf ${{ secrets.QUAY_PASSWORD }} | docker login --username ${{ secrets.QUAY_USERNAME }} quay.io --password-stdin TAG=$(git describe --tags --always) echo TAG=${TAG##v} >> $GITHUB_ENV - name: Build image, retag and push if: success() run: | docker build -t ethersphere/gateway-proxy:${TAG} . - docker tag ethersphere/gateway-proxy:${TAG} quay.io/ethersphere/gateway-proxy:${TAG} docker push ethersphere/gateway-proxy:${TAG} - docker push quay.io/ethersphere/gateway-proxy:${TAG} diff --git a/.github/workflows/release_github.yaml b/.github/workflows/release_github.yaml index cf6a9f1..8f3cca3 100644 --- a/.github/workflows/release_github.yaml +++ b/.github/workflows/release_github.yaml @@ -10,13 +10,15 @@ on: jobs: release-please: runs-on: ubuntu-latest + # Only this environment (default branch only) holds RELEASE_APP_KEY. + environment: release-ci steps: - name: Generate App token id: app-token - uses: actions/create-github-app-token@v1 + uses: actions/create-github-app-token@d72941d797fd3113feb6b93fd0dec494b13a2547 # v1.12.0 with: - app-id: ${{ secrets.BEE_RUNNER_APP_ID }} - private-key: ${{ secrets.BEE_RUNNER_KEY }} + app-id: ${{ vars.RELEASE_APP_ID }} + private-key: ${{ secrets.RELEASE_APP_KEY }} owner: ${{ github.repository_owner }} repositories: gateway-proxy # contents: commits, branches, tags and the GitHub release @@ -26,7 +28,7 @@ jobs: permission-pull-requests: write permission-issues: write - - uses: GoogleCloudPlatform/release-please-action@v2 + - uses: googleapis/release-please-action@00911586051618367fa9c19b161a0a146ac51970 # v2 id: release with: token: ${{ steps.app-token.outputs.token }}