refactor: Move creation of nginx image to separate job

This commit is contained in:
2025-08-02 21:47:35 +02:00
parent 60e3a117be
commit f66c60ffca
+18 -6
View File
@@ -27,19 +27,19 @@ jobs:
id: detect id: detect
run: | run: |
echo "changed_envs=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^docker/' | cut -d/ -f2 | sort -u | tr '\n' ' ')" >> "$GITHUB_OUTPUT" echo "changed_envs=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '^docker/' | cut -d/ -f2 | sort -u | tr '\n' ' ')" >> "$GITHUB_OUTPUT"
deploy: create-nginx:
name: Deploy name: Build Nginx image
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: fact-finding needs: fact-finding
strategy:
matrix:
env: [ test ]
environment: ${{ matrix.env }}
permissions: permissions:
contents: read contents: read
packages: write packages: write
attestations: write attestations: write
id-token: write id-token: write
strategy:
matrix:
env: [ test ]
environment: ${{ matrix.env }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Exit if this environment wasn't changed - name: Exit if this environment wasn't changed
@@ -84,6 +84,18 @@ jobs:
with: with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }} subject-digest: ${{ steps.push.outputs.digest }}
deploy:
name: Deploy
runs-on: ubuntu-latest
needs:
- fact-finding
- create-nginx
strategy:
matrix:
env: [ test ]
environment: ${{ matrix.env }}
steps:
- uses: actions/checkout@v4
- name: Copy files to remote - name: Copy files to remote
if: steps.check.outputs.should_deploy == 'true' if: steps.check.outputs.should_deploy == 'true'
uses: burnett01/rsync-deployments@7.0.2 uses: burnett01/rsync-deployments@7.0.2