build #553
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
name: build | |
on: | |
push: | |
branches: | |
- 'master' | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
# Run a weekly update to get the latest packages | |
workflow_dispatch: | |
schedule: | |
- cron: 0 9 * * * | |
jobs: | |
build_images: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
# The docker_target is a stage within the multistage pipeline | |
# The tag is what we push to dockerhub under the hamletio/hamlet image | |
- docker_target: hamlet | |
suffix: '' | |
- docker_target: jenkins-agent | |
suffix: -jenkins | |
- docker_target: azure-pipelines-agent | |
suffix: -azpipeline | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: docker meta details | |
id: meta | |
uses: docker/metadata-action@v3 | |
with: | |
images: hamletio/hamlet | |
flavor: | | |
latest=auto | |
suffix=${{ matrix.suffix }},onlatest=true | |
tags: | | |
type=edge,branch=master | |
type=semver,pattern={{version}} | |
type=schedule,pattern=nightly | |
type=schedule,pattern=schedule-{{date 'YYYYMMDD'}} | |
type=sha | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Login Dockerhub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
if: ${{ github.event_name == 'scheduled' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }} | |
- name: Push Release | |
uses: docker/build-push-action@v2 | |
with: | |
push: ${{ github.event_name == 'scheduled' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
target: ${{ matrix.docker_target }} |