docker-wikibase-actions-workflow #1202
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: docker-wikibase-actions-workflow | |
on: | |
push: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
PUSH_IMAGE: ${{ github.event_name != 'pull_request' | |
&& true || false}} | |
jobs: | |
build-base: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/[email protected] | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push Docker image | |
uses: docker/[email protected] | |
with: | |
context: . | |
push: ${{ env.PUSH_IMAGE }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-dev: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: build-base | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push Docker dev image | |
uses: docker/[email protected] | |
with: | |
context: dev | |
push: ${{ env.PUSH_IMAGE }} | |
tags: ghcr.io/mardi4nfdi/docker-wikibase:dev | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-jobrunner: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: build-base | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push Docker jobrunner image | |
uses: docker/[email protected] | |
with: | |
context: jobrunner | |
push: ${{ env.PUSH_IMAGE }} | |
tags: ghcr.io/mardi4nfdi/docker-redis-jobrunner | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-backup: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
needs: build-base | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Log in to the Container registry | |
uses: docker/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/[email protected] | |
- name: Build and push Docker jobrunner image | |
uses: docker/[email protected] | |
with: | |
context: backup | |
push: ${{ env.PUSH_IMAGE }} | |
tags: ghcr.io/mardi4nfdi/docker-backup | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |