Skip to content

revamp events array #19

revamp events array

revamp events array #19

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
paths-ignore:
- '.gitignore'
- 'renovate.json'
- 'README.md'
pull_request:
branches: [ "main" ]
paths-ignore:
- '.gitignore'
- 'renovate.json'
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
concurrency:
cancel-in-progress: true
group: ${{ github.repository }}-${{ github.event_name }}-builder
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set env var for tag
if: github.event_name != 'pull_request'
run: |
if [[ "${{ github.event.head_commit.message }}" == WIP:* ]]; then
echo "DOCKER_IMAGE_TAG=wip" >> $GITHUB_ENV
else
echo "DOCKER_IMAGE_TAG=latest" >> $GITHUB_ENV
fi
- name: Build image and push to GHCR
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ghcr.io/luiggi33/berlin-police-feed:${{ env.DOCKER_IMAGE_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
github-token: ${{ secrets.GITHUB_TOKEN }}