From 63ddc8a361612bc3e7a3c01d10fba52e04ec668c Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 7 Sep 2021 15:07:04 +0200 Subject: [PATCH 1/3] docker --- .github/workflows/docker-publish.yml | 57 ++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000000..84c641521f --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,57 @@ +name: docker + +on: + schedule: + - cron: '19 17 * * *' # Nightly builds capture upstream updates to dependency images such as node. + push: + branches: [ master ] + tags: [ '*.*.*' ] + pull_request: + branches: [ master ] + +env: + REGISTRY: docker.io + IMAGE_NAME: parseplatform/parse-server + +jobs: + build: + + runs-on: ubuntu-18.04 + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up QEMU + id: qemu + uses: docker/setup-qemu-action@v1 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Log into Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v3 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + flavor: | + latest=true + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + platforms: linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64/v8 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} From 5a4c9efff56120a1c59b1b6dd6205217530ae4fd Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 7 Sep 2021 16:20:11 +0200 Subject: [PATCH 2/3] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 84c641521f..cceea0135d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,10 +4,8 @@ on: schedule: - cron: '19 17 * * *' # Nightly builds capture upstream updates to dependency images such as node. push: - branches: [ master ] + branches: [ master, '*.*.*' ] tags: [ '*.*.*' ] - pull_request: - branches: [ master ] env: REGISTRY: docker.io @@ -22,6 +20,10 @@ jobs: packages: write steps: + - name: Determine branch name + id: branch + run: echo ::set-output name=branch_name::${GITHUB_REF#refs/*/} + - name: Checkout repository uses: actions/checkout@v2 @@ -45,7 +47,7 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} flavor: | - latest=true + latest=${{ steps.branch.branch_name == 'master' }} - name: Build and push Docker image uses: docker/build-push-action@v2 From f056e3fe64cd4098b90a2520351565af0c48d005 Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Tue, 7 Sep 2021 16:24:18 +0200 Subject: [PATCH 3/3] Update docker-publish.yml --- .github/workflows/docker-publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index cceea0135d..05c7c416df 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '19 17 * * *' # Nightly builds capture upstream updates to dependency images such as node. push: - branches: [ master, '*.*.*' ] + branches: [ master, 'release-*.*.*' ] tags: [ '*.*.*' ] env: