-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Actions: added PR builder and release hub push (#67)
* Github Actions: added PR builder and release hub push * README: updated release management docs * Main: enable variant-less build and latest Co-authored-by: Bryan Latten <latten@adobe.com>
- Loading branch information
1 parent
a00ed1a
commit 5fe94b8
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: main | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_BASE: behance/docker-base | ||
strategy: | ||
matrix: | ||
props: | ||
# This is the default variant-less distribution (ex. 3.2.1) | ||
- Dockerfile: Dockerfile-ubuntu-20.04 | ||
# Variant distributions below all have semantic versions + suffix (ex. 3.2.1-ubuntu-18.04) | ||
- Dockerfile: Dockerfile-ubuntu-18.04 | ||
suffix: ubuntu-18.04 | ||
- Dockerfile: Dockerfile-ubuntu-20.04 | ||
suffix: ubuntu-20.04 | ||
- Dockerfile: Dockerfile-alpine | ||
suffix: alpine | ||
- Dockerfile: Dockerfile-centos-7 | ||
suffix: centos-7 | ||
- Dockerfile: Dockerfile-centos-8 | ||
suffix: centos-8 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Add tag suffix | ||
if: matrix.props.suffix | ||
run: | | ||
echo TAG_SUFFIX="-${{ matrix.props.suffix }}" >> $GITHUB_ENV | ||
- | ||
name: Docker meta | ||
id: meta | ||
if: github.event_name != 'pull_request' | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.IMAGE_BASE }} | ||
tags: | | ||
type=semver,pattern={{major}}.{{minor}}.{{patch}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
flavor: | | ||
latest=auto | ||
suffix=${{ env.TAG_SUFFIX }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build + push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: ${{ matrix.props.Dockerfile }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: ${{ github.event_name != 'pull_request' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters