Skip to content

Commit

Permalink
ci(Update build.yml): 💚
Browse files Browse the repository at this point in the history
  • Loading branch information
thezak48 committed Nov 9, 2024
1 parent 91b2c6f commit aa15e5e
Showing 1 changed file with 39 additions and 21 deletions.
60 changes: 39 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,35 @@ name: Build Docker Image

on:
push:
branches:
- 'develop'
- 'influxdbv2'
branches:
- "develop"
tags:
- 'v*.*.*'
- "*"
paths-ignore:
- "assets/**"
- "data/**"
- "systemd/**"
- "README.md"
- "renovate.json"
pull_request:
branches:
- "develop"
paths-ignore:
- "assets/**"
- "data/**"
- "systemd/**"
- "README.md"
- "renovate.json"

jobs:

build:

build-and-push-docker:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
Expand All @@ -28,33 +40,39 @@ jobs:

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/thezak48/varken
ghcr.io/thezak48/manga_dl
flavor: |
latest=auto
tags: |
type=schedule
type=ref,event=pr
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=edge,branch=develop
type=ref,event=pr
type=sha
type=ref,event=branch
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_ZAK }}

- name: Docker build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
push: ${{ github.event.pull_request.head.repo.full_name == 'thezak48/manga_dl' || github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
VCS_REF=${{ github.sha }}
VERSION=${{ steps.meta.outputs.tags }}

0 comments on commit aa15e5e

Please sign in to comment.