Skip to content

build image

build image #1017

Workflow file for this run

name: build image
on:
schedule:
- cron: '3 3 * * *'
pull_request:
push:
branches: main
tags:
- 'v*'
jobs:
build-container:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/eyenx/blog
# generate Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PAT }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: |
${{ steps.meta.output.labels }}
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/${{ github.event.repository.default_branch }}/README.md
- name: trigger deployment
run: |
docker run -e DRONE_REPO -e DRONE_ARGS -e DRONE_TOKEN -e DRONE_SERVER ghcr.io/eyenx/drone-build-trigger
env:
DRONE_SERVER: ${{ secrets.DRONE_SERVER }}
DRONE_TOKEN: ${{ secrets.DRONE_TOKEN }}
DRONE_REPO: ${{ secrets.DRONE_REPO }}
DRONE_ARGS: "-p DEPLOY=eyenx.ch"