Skip to content

Commit

Permalink
ci: update docker image building (parse-community#7553)
Browse files Browse the repository at this point in the history
* docker

* Update docker-publish.yml

* Update docker-publish.yml
  • Loading branch information
mtrezza committed Sep 7, 2021
1 parent c71ae7d commit ef2ec21
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/docker-publish.yml
@@ -0,0 +1,59 @@
name: docker

on:
schedule:
- cron: '19 17 * * *' # Nightly builds capture upstream updates to dependency images such as node.
push:
branches: [ master, 'release-*.*.*' ]
tags: [ '*.*.*' ]

env:
REGISTRY: docker.io
IMAGE_NAME: parseplatform/parse-server

jobs:
build:

runs-on: ubuntu-18.04
permissions:
contents: read
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

- 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=${{ steps.branch.branch_name == 'master' }}
- 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 }}

0 comments on commit ef2ec21

Please sign in to comment.