Format YAML

This commit is contained in:
Jonatan Kłosko 2022-11-30 19:37:15 +01:00
parent d44d5b0f62
commit a6c9e1103c
5 changed files with 12 additions and 15 deletions

View file

@ -15,4 +15,4 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
memory: 2000M memory: 2000M

View file

@ -1,10 +1,9 @@
name: Preview (build) name: Preview (build)
on: on:
pull_request: pull_request:
types: [opened,synchronize,reopened,closed] types: [opened, synchronize, reopened, closed]
jobs: jobs:
build-application: build-application:
name: Build PR image name: Build PR image
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -15,7 +14,7 @@ jobs:
- name: Checkout git repo - name: Checkout git repo
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Generate UUID image name - name: Generate UUID image name
id: uuid id: uuid
run: echo "UUID_TAG_APP=$(uuidgen)" >> $GITHUB_ENV run: echo "UUID_TAG_APP=$(uuidgen)" >> $GITHUB_ENV
@ -34,14 +33,13 @@ jobs:
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
file: ./Dockerfile file: ./Dockerfile
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
render-compose-file: render-compose-file:
name: Render Docker Compose file name: Render Docker Compose file
# Pass output of this workflow to another triggered by `workflow_run` event. # Pass output of this workflow to another triggered by `workflow_run` event.
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build-application - build-application
steps: steps:
- name: Checkout git repo - name: Checkout git repo
@ -60,10 +58,10 @@ jobs:
path: docker-compose.rendered.yml path: docker-compose.rendered.yml
retention-days: 2 retention-days: 2
- name: Serialize PR Event to File - name: Serialize PR Event to File
run: | run: |
cat << EOF > event.json cat << EOF > event.json
${{ toJSON(github.event) }} ${{ toJSON(github.event) }}
EOF EOF
- name: Upload PR Event as Artifact - name: Upload PR Event as Artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -85,4 +83,4 @@ jobs:
with: with:
name: preview-spec name: preview-spec
path: event.json path: event.json
retention-days: 2 retention-days: 2

View file

@ -7,7 +7,6 @@ on:
types: types:
- completed - completed
jobs: jobs:
cache-compose-file: cache-compose-file:
name: Cache Docker Compose file name: Cache Docker Compose file
@ -16,7 +15,7 @@ jobs:
compose-file-cache-key: ${{ env.COMPOSE_FILE_HASH }} compose-file-cache-key: ${{ env.COMPOSE_FILE_HASH }}
pr-number: ${{ env.PR_NUMBER }} pr-number: ${{ env.PR_NUMBER }}
steps: steps:
- name: 'Download artifacts' - name: "Download artifacts"
# Fetch output (zip archive) from the workflow run that triggered this workflow. # Fetch output (zip archive) from the workflow run that triggered this workflow.
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
@ -37,7 +36,7 @@ jobs:
}); });
let fs = require('fs'); let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data));
- name: 'Unzip artifact' - name: "Unzip artifact"
run: unzip preview-spec.zip run: unzip preview-spec.zip
- name: Read Event into ENV - name: Read Event into ENV
run: | run: |
@ -81,4 +80,4 @@ jobs:
permissions: permissions:
contents: read contents: read
pull-requests: write pull-requests: write
id-token: write id-token: write