Merge pull request #15 from silinternational/dev-8.1 #35
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 and Publish | |
on: | |
push: | |
branches: ['8.*'] | |
schedule: | |
# High load times include the start of every hour. | |
# If the load is sufficiently high enough, some queued jobs may be dropped. | |
# To decrease the chance of delay, schedule your workflow to run at a different time of the hour. | |
# cron: Minutes Hours Day-of-month Month Day-of-week | |
- cron: "7 1 8 * *" | |
jobs: | |
build-and-publish: | |
name: Build and Publish | |
runs-on: ubuntu-latest | |
timeout-minutes: ${{ fromJSON(vars.DEFAULT_JOB_TIMEOUT_MINUTES) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Log in to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
${{ vars.DOCKER_ORG }}/php8 | |
ghcr.io/${{ github.repository_owner }}/php8 | |
tags: | | |
type=ref,event=branch | |
# set latest tag for default branch | |
type=raw,value=latest,enable={{is_default_branch}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |