Merge pull request #2301 from element-hq/fkwp-patch-1

gh actions refactor
This commit is contained in:
fkwp 2024-04-10 16:36:28 +02:00 committed by GitHub
commit 922bb00722
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View File

@ -27,7 +27,7 @@ jobs:
- name: Upload Artifact - name: Upload Artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: build name: build-output
path: dist path: dist
# We'll only use this in a triggered job, then we're done with it # We'll only use this in a triggered job, then we're done with it
retention-days: 1 retention-days: 1

View File

@ -10,14 +10,20 @@ on:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }} IMAGE_NAME: ${{ github.repository }}
DO_DOCKER_BUILD: ${{ contains(github.event.pull_request.labels.*.name, 'docker build') }}
jobs: jobs:
build_element_call: build_element_call:
if: ${{ contains(github.event.pull_request.labels.*.name, 'docker build') }} if: ${{ env.DO_DOCKER_BUILD }}
uses: ./.github/workflows/build_resuable.yaml uses: ./.github/workflows/build_resuable.yaml
secrets:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_URL: ${{ secrets.SENTRY_URL }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
build_docker: build_docker:
if: ${{ contains(github.event.pull_request.labels.*.name, 'docker build') }} if: ${{ env.DO_DOCKER_BUILD }}
needs: build_element_call needs: build_element_call
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
@ -29,9 +35,7 @@ jobs:
- name: 📥 Download artifact - name: 📥 Download artifact
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} name: build-output
run_id: ${{ github.event.workflow_run.id }}
name: build
path: dist path: dist
- name: Log in to container registry - name: Log in to container registry
@ -48,7 +52,7 @@ jobs:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: | tags: |
type=sha,format=short,event=branch type=sha,format=short,event=branch
type=raw,value=pr_${{ github.event.workflow_run.pull_requests[0].number }} type=raw,value=pr_${{ github.event.pull_request.number }}
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb